Archived
1
0
Fork 0

services: ssh: Deprecate 'lsh-service' procedure.

* doc/guix.texi (Networking Services): Remove mention of lsh-service.
Document lsh-service-type and lsh-service-configuration.
* gnu/services/ssh.scm (<lsh-configuration>): Set default values based
on the now deprecated 'lsh-service' procedure.
(lsh-service-type): Set default value.
(lsh-service): Deprecate procedure.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Bruno Victal 2023-02-25 18:57:58 +00:00 committed by Ludovic Courtès
parent 31b1e22926
commit 0e21015fd2
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 101 additions and 55 deletions

View file

@ -20725,41 +20725,71 @@ Furthermore, @code{(gnu services ssh)} provides the following services.
@cindex SSH @cindex SSH
@cindex SSH server @cindex SSH server
@deffn {Scheme Procedure} lsh-service [#:host-key "/etc/lsh/host-key"] @ @defvar lsh-service-type
[#:daemonic? #t] [#:interfaces '()] [#:port-number 22] @ Type of the service that runs the GNU@tie{}lsh secure shell (SSH)
[#:allow-empty-passwords? #f] [#:root-login? #f] @ daemon, @command{lshd}. The value for this service is a
[#:syslog-output? #t] [#:x11-forwarding? #t] @ @code{<lsh-configuration>} object.
[#:tcp/ip-forwarding? #t] [#:password-authentication? #t] @ @end defvar
[#:public-key-authentication? #t] [#:initialize? #t]
Run the @command{lshd} program from @var{lsh} to listen on port @var{port-number}.
@var{host-key} must designate a file containing the host key, and readable
only by root.
When @var{daemonic?} is true, @command{lshd} will detach from the @deftp {Data Type} lsh-configuration
controlling terminal and log its output to syslogd, unless one sets Data type representing the configuration of @command{lshd}.
@var{syslog-output?} to false. Obviously, it also makes lsh-service
depend on existence of syslogd service. When @var{pid-file?} is true,
@command{lshd} writes its PID to the file called @var{pid-file}.
When @var{initialize?} is true, automatically create the seed and host key @table @asis
upon service activation if they do not exist yet. This may take long and @item @code{lsh} (default: @code{lsh}) (type: file-like)
require interaction. The package object of the GNU@tie{}lsh secure shell (SSH) daemon.
When @var{initialize?} is false, it is up to the user to initialize the @item @code{daemonic?} (default: @code{#t}) (type: boolean)
randomness generator (@pxref{lsh-make-seed,,, lsh, LSH Manual}), and to create Whether to detach from the controlling terminal.
a key pair with the private key stored in file @var{host-key} (@pxref{lshd
basics,,, lsh, LSH Manual}).
When @var{interfaces} is empty, lshd listens for connections on all the @item @code{host-key} (default: @code{"/etc/lsh/host-key"}) (type: string)
network interfaces; otherwise, @var{interfaces} must be a list of host names File containing the @dfn{host key}. This file must be readable by
or addresses. root only.
@var{allow-empty-passwords?} specifies whether to accept log-ins with empty @item @code{interfaces} (default: @code{()}) (type: list)
passwords, and @var{root-login?} specifies whether to accept log-ins as List of host names or addresses that @command{lshd} will listen on.
root. If empty, @command{lshd} listens for connections on all the network
interfaces.
The other options should be self-descriptive. @item @code{port-number} (default: @code{22}) (type: integer)
@end deffn Port to listen on.
@item @code{allow-empty-passwords?} (default: @code{#f}) (type: boolean)
Whether to accept log-ins with empty passwords.
@item @code{root-login?} (default: @code{#f}) (type: boolean)
Whether to accept log-ins as root.
@item @code{syslog-output?} (default: @code{#t}) (type: boolean)
Whether to log @command{lshd} standard output to syslogd.
This will make the service depend on the existence of a syslogd service.
@item @code{pid-file?} (default: @code{#f}) (type: boolean)
When @code{#t}, @command{lshd} writes its PID to the file specified in
@var{pid-file}.
@item @code{pid-file} (default: @code{"/var/run/lshd.pid"}) (type: string)
File that @command{lshd} will write its PID to.
@item @code{x11-forwarding?} (default: @code{#t}) (type: boolean)
Whether to enable X11 forwarding.
@item @code{tcp/ip-forwarding?} (default: @code{#t}) (type: boolean)
Whether to enable TCP/IP forwarding.
@item @code{password-authentication?} (default: @code{#t}) (type: boolean)
Whether to accept log-ins using password authentication.
@item @code{public-key-authentication?} (default: @code{#t}) (type: boolean)
Whether to accept log-ins using public key authentication.
@item @code{initialize?} (default: @code{#t}) (type: boolean)
When @code{#f}, it is up to the user to initialize the randomness
generator (@pxref{lsh-make-seed,,, lsh, LSH Manual}), and to create
a key pair with the private key stored in file @var{host-key}
(@pxref{lshd basics,,, lsh, LSH Manual}).
@end table
@end deftp
@cindex SSH @cindex SSH
@cindex SSH server @cindex SSH server

View file

@ -42,7 +42,7 @@
#:use-module (ice-9 vlist) #:use-module (ice-9 vlist)
#:export (lsh-configuration #:export (lsh-configuration
lsh-configuration? lsh-configuration?
lsh-service lsh-service ; deprecated
lsh-service-type lsh-service-type
openssh-configuration openssh-configuration
@ -74,20 +74,34 @@
lsh-configuration? lsh-configuration?
(lsh lsh-configuration-lsh (lsh lsh-configuration-lsh
(default lsh)) (default lsh))
(daemonic? lsh-configuration-daemonic?) (daemonic? lsh-configuration-daemonic?
(host-key lsh-configuration-host-key) (default #t))
(interfaces lsh-configuration-interfaces) (host-key lsh-configuration-host-key
(port-number lsh-configuration-port-number) (default "/etc/lsh/host-key"))
(allow-empty-passwords? lsh-configuration-allow-empty-passwords?) (interfaces lsh-configuration-interfaces
(root-login? lsh-configuration-root-login?) (default '()))
(syslog-output? lsh-configuration-syslog-output?) (port-number lsh-configuration-port-number
(pid-file? lsh-configuration-pid-file?) (default 22))
(pid-file lsh-configuration-pid-file) (allow-empty-passwords? lsh-configuration-allow-empty-passwords?
(x11-forwarding? lsh-configuration-x11-forwarding?) (default #f))
(tcp/ip-forwarding? lsh-configuration-tcp/ip-forwarding?) (root-login? lsh-configuration-root-login?
(password-authentication? lsh-configuration-password-authentication?) (default #f))
(public-key-authentication? lsh-configuration-public-key-authentication?) (syslog-output? lsh-configuration-syslog-output?
(initialize? lsh-configuration-initialize?)) (default #t))
(pid-file? lsh-configuration-pid-file?
(default #f))
(pid-file lsh-configuration-pid-file
(default "/var/run/lshd.pid"))
(x11-forwarding? lsh-configuration-x11-forwarding?
(default #t))
(tcp/ip-forwarding? lsh-configuration-tcp/ip-forwarding?
(default #t))
(password-authentication? lsh-configuration-password-authentication?
(default #t))
(public-key-authentication? lsh-configuration-public-key-authentication?
(default #t))
(initialize? lsh-configuration-initialize?
(default #t)))
(define %yarrow-seed (define %yarrow-seed
"/var/spool/lsh/yarrow-seed-file") "/var/spool/lsh/yarrow-seed-file")
@ -203,19 +217,20 @@
(lsh-configuration-allow-empty-passwords? config)))) (lsh-configuration-allow-empty-passwords? config))))
(define lsh-service-type (define lsh-service-type
(service-type (name 'lsh) (service-type
(description (name 'lsh)
"Run the GNU@tie{}lsh secure shell (SSH) daemon, (extensions
(list (service-extension shepherd-root-service-type
lsh-shepherd-service)
(service-extension pam-root-service-type
lsh-pam-services)
(service-extension activation-service-type
lsh-activation)))
(description "Run the GNU@tie{}lsh secure shell (SSH) daemon,
@command{lshd}.") @command{lshd}.")
(extensions (default-value (lsh-configuration))))
(list (service-extension shepherd-root-service-type
lsh-shepherd-service)
(service-extension pam-root-service-type
lsh-pam-services)
(service-extension activation-service-type
lsh-activation)))))
(define* (lsh-service #:key (define-deprecated (lsh-service #:key
(lsh lsh) (lsh lsh)
(daemonic? #t) (daemonic? #t)
(host-key "/etc/lsh/host-key") (host-key "/etc/lsh/host-key")
@ -231,6 +246,7 @@
(password-authentication? #t) (password-authentication? #t)
(public-key-authentication? #t) (public-key-authentication? #t)
(initialize? #t)) (initialize? #t))
lsh-service-type
"Run the @command{lshd} program from @var{lsh} to listen on port @var{port-number}. "Run the @command{lshd} program from @var{lsh} to listen on port @var{port-number}.
@var{host-key} must designate a file containing the host key, and readable @var{host-key} must designate a file containing the host key, and readable
only by root. only by root.