diff options
author | Ludovic Courtès <ludo@gnu.org> | 2022-04-28 16:24:46 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2022-04-28 16:24:46 +0200 |
commit | 284fa7264963acc5d114ef5d54c347126b1654ba (patch) | |
tree | 3e5360fcc81b6d0dce76a65aca60cf8528f2931f /gnu/services/ssh.scm | |
parent | 12c9da35389dfba86ae0d863132a6b2c4374205a (diff) | |
parent | 882cacc1bb5be0df334dd7ce55b385a3a1678728 (diff) | |
download | guix-patches-284fa7264963acc5d114ef5d54c347126b1654ba.tar guix-patches-284fa7264963acc5d114ef5d54c347126b1654ba.tar.gz |
Merge branch 'master' into staging
Diffstat (limited to 'gnu/services/ssh.scm')
-rw-r--r-- | gnu/services/ssh.scm | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index 5c8fe4eef4..7fbbe383e5 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm @@ -292,6 +292,9 @@ The other options should be self-descriptive." ;; integer (port-number openssh-configuration-port-number (default 22)) + ;; integer + (max-connections openssh-configuration-max-connections + (default 200)) ;; Boolean | 'prohibit-password (permit-root-login openssh-configuration-permit-root-login (default #f)) @@ -515,6 +518,12 @@ of user-name/file-like tuples." (define pid-file (openssh-configuration-pid-file config)) + (define port-number + (openssh-configuration-port-number config)) + + (define max-connections + (openssh-configuration-max-connections config)) + (define openssh-command #~(list (string-append #$(openssh-configuration-openssh config) "/sbin/sshd") "-D" "-f" #$(openssh-config-file config))) @@ -523,9 +532,17 @@ of user-name/file-like tuples." (documentation "OpenSSH server.") (requirement '(syslogd loopback)) (provision '(ssh-daemon ssh sshd)) - (start #~(make-forkexec-constructor #$openssh-command - #:pid-file #$pid-file)) - (stop #~(make-kill-destructor)) + (start #~(if (defined? 'make-inetd-constructor) + (make-inetd-constructor + (append #$openssh-command '("-i")) + (make-socket-address AF_INET INADDR_ANY + #$port-number) + #:max-connections #$max-connections) + (make-forkexec-constructor #$openssh-command + #:pid-file #$pid-file))) + (stop #~(if (defined? 'make-inetd-destructor) + (make-inetd-destructor) + (make-kill-destructor))) (auto-start? (openssh-auto-start? config))))) (define (openssh-pam-services config) |