[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] services: openssh: Enable PAM.
From: |
Clément Lassieur |
Subject: |
[PATCH 1/2] services: openssh: Enable PAM. |
Date: |
Sat, 18 Feb 2017 12:46:16 +0100 |
* gnu/services/ssh.scm: (%openssh-pam-services): New variable.
(openssh-service-type): Use it to extend PAM-ROOT-SERVICE-TYPE.
(<openssh-configuration>)[challenge-response-authentication?]: New field.
(<openssh-configuration>)[use-pam?]: New field.
(openssh-config-file): Add them.
* doc/guix.texi (Networking Services): Document them.
---
doc/guix.texi | 16 ++++++++++++++++
gnu/services/ssh.scm | 19 ++++++++++++++++++-
2 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 6cdb5e592..22eef3a64 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -9163,6 +9163,22 @@ enabled---in other words, @command{ssh} options
@option{-X} and
@item @code{protocol-number} (default: @code{2})
The SSH protocol number to use.
+
address@hidden @code{challenge-response-authentication?} (default: @code{#f})
+Specifies whether challenge response authentication is allowed (e.g. via
+PAM).
+
address@hidden @code{use-pam?} (default: @code{#t})
+Enables the Pluggable Authentication Module interface. If set to
address@hidden, this will enable PAM authentication using
address@hidden and
address@hidden, in addition to PAM account and session
+module processing for all authentication types.
+
+Because PAM challenge response authentication usually serves an
+equivalent role to password authentication, you should disable either
address@hidden or
address@hidden
@end table
@end deftp
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm
index 58c35c9f5..7d6abcd33 100644
--- a/gnu/services/ssh.scm
+++ b/gnu/services/ssh.scm
@@ -278,7 +278,12 @@ The other options should be self-descriptive."
(x11-forwarding? openssh-configuration-x11-forwarding? ;Boolean
(default #f))
(protocol-number openssh-configuration-protocol-number ;integer
- (default 2)))
+ (default 2))
+ (challenge-response-authentication?
+ openssh-configuration-challenge-response-authentication? ;Boolean
+ (default #f))
+ (use-pam? openssh-configuration-use-pam? ;Boolean
+ (default #t)))
(define %openssh-accounts
(list (user-group (name "sshd") (system? #t))
@@ -334,6 +339,13 @@ The other options should be self-descriptive."
"yes" "no"))
(format port "PidFile ~a\n"
#$(openssh-configuration-pid-file config))
+ (format port "ChallengeResponseAuthentication ~a\n"
+ #$(if
(openssh-configuration-challenge-response-authentication?
+ config)
+ "yes" "no"))
+ (format port "UsePAM ~a\n"
+ #$(if (openssh-configuration-use-pam? config)
+ "yes" "no"))
#t))))
(define (openssh-shepherd-service config)
@@ -354,11 +366,16 @@ The other options should be self-descriptive."
#:pid-file #$pid-file))
(stop #~(make-kill-destructor)))))
+(define %openssh-pam-services
+ (list (unix-pam-service "sshd")))
+
(define openssh-service-type
(service-type (name 'openssh)
(extensions
(list (service-extension shepherd-root-service-type
openssh-shepherd-service)
+ (service-extension pam-root-service-type
+ (const %openssh-pam-services))
(service-extension activation-service-type
openssh-activation)
(service-extension account-service-type
--
2.11.1
- [PATCH 0/2] Openssh service patches, Clément Lassieur, 2017/02/17
- [PATCH 2/2] services: openssh: remove deprecated 'RSAAuthentication' option., Clément Lassieur, 2017/02/17
- [PATCH 1/2] services: openssh: Use PAM in sshd by default., Clément Lassieur, 2017/02/17
- Re: [PATCH 0/2] Openssh service patches, ng0, 2017/02/17
- Re: [PATCH 0/2] Openssh service patches, Julien Lepiller, 2017/02/17
- [PATCH 1/2] services: openssh: Enable PAM.,
Clément Lassieur <=
- [PATCH 2/2] services: openssh: Remove deprecated 'RSAAuthentication' option., Clément Lassieur, 2017/02/18
- Re: [PATCH 2/2] services: openssh: Remove deprecated 'RSAAuthentication' option., Ricardo Wurmus, 2017/02/18
- Re: [PATCH 2/2] services: openssh: Remove deprecated 'RSAAuthentication' option., Clément Lassieur, 2017/02/18
- Re: [PATCH 2/2] services: openssh: Remove deprecated 'RSAAuthentication' option., ng0, 2017/02/19
- [PATCH 0/4] Openssh service patches, Clément Lassieur, 2017/02/20
- [PATCH 4/4] services: openssh: Add 'subsystems' option., Clément Lassieur, 2017/02/20
- [PATCH 2/4] services: openssh: Remove deprecated options., Clément Lassieur, 2017/02/20
- [PATCH 3/4] services: openssh: Fix 'PrintLastLog' default behaviour., Clément Lassieur, 2017/02/20
- [PATCH 1/4] services: openssh: Enable PAM., Clément Lassieur, 2017/02/20
- Re: [PATCH 1/4] services: openssh: Enable PAM., Clément Lassieur, 2017/02/22