diff options
| author | Bruno Victal <mirai@makinata.eu> | 2023-02-25 18:57:58 +0000 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2023-03-03 17:55:33 +0100 |
| commit | 0e21015fd2214aade16de35ce5a79bcc192530c7 (patch) | |
| tree | 9033117a4b2bea5f553c7f626c173ae8dd56f60d | |
| parent | 31b1e229268683826524cb93dd2da8d46dd77343 (diff) | |
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>
| -rw-r--r-- | doc/guix.texi | 98 | ||||
| -rw-r--r-- | gnu/services/ssh.scm | 68 |
2 files changed, 106 insertions, 60 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 1edbad33c66..9c30e97466b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -20725,41 +20725,71 @@ Furthermore, @code{(gnu services ssh)} provides the following services. | |||
| 20725 | @cindex SSH | 20725 | @cindex SSH |
| 20726 | @cindex SSH server | 20726 | @cindex SSH server |
| 20727 | 20727 | ||
| 20728 | @deffn {Scheme Procedure} lsh-service [#:host-key "/etc/lsh/host-key"] @ | 20728 | @defvar lsh-service-type |
| 20729 | [#:daemonic? #t] [#:interfaces '()] [#:port-number 22] @ | 20729 | Type of the service that runs the GNU@tie{}lsh secure shell (SSH) |
| 20730 | [#:allow-empty-passwords? #f] [#:root-login? #f] @ | 20730 | daemon, @command{lshd}. The value for this service is a |
| 20731 | [#:syslog-output? #t] [#:x11-forwarding? #t] @ | 20731 | @code{<lsh-configuration>} object. |
| 20732 | [#:tcp/ip-forwarding? #t] [#:password-authentication? #t] @ | 20732 | @end defvar |
| 20733 | [#:public-key-authentication? #t] [#:initialize? #t] | ||
| 20734 | Run the @command{lshd} program from @var{lsh} to listen on port @var{port-number}. | ||
| 20735 | @var{host-key} must designate a file containing the host key, and readable | ||
| 20736 | only by root. | ||
| 20737 | |||
| 20738 | When @var{daemonic?} is true, @command{lshd} will detach from the | ||
| 20739 | controlling terminal and log its output to syslogd, unless one sets | ||
| 20740 | @var{syslog-output?} to false. Obviously, it also makes lsh-service | ||
| 20741 | depend on existence of syslogd service. When @var{pid-file?} is true, | ||
| 20742 | @command{lshd} writes its PID to the file called @var{pid-file}. | ||
| 20743 | |||
| 20744 | When @var{initialize?} is true, automatically create the seed and host key | ||
| 20745 | upon service activation if they do not exist yet. This may take long and | ||
| 20746 | require interaction. | ||
| 20747 | |||
| 20748 | When @var{initialize?} is false, it is up to the user to initialize the | ||
| 20749 | randomness generator (@pxref{lsh-make-seed,,, lsh, LSH Manual}), and to create | ||
| 20750 | a key pair with the private key stored in file @var{host-key} (@pxref{lshd | ||
| 20751 | basics,,, lsh, LSH Manual}). | ||
| 20752 | |||
| 20753 | When @var{interfaces} is empty, lshd listens for connections on all the | ||
| 20754 | network interfaces; otherwise, @var{interfaces} must be a list of host names | ||
| 20755 | or addresses. | ||
| 20756 | |||
| 20757 | @var{allow-empty-passwords?} specifies whether to accept log-ins with empty | ||
| 20758 | passwords, and @var{root-login?} specifies whether to accept log-ins as | ||
| 20759 | root. | ||
| 20760 | 20733 | ||
| 20761 | The other options should be self-descriptive. | 20734 | @deftp {Data Type} lsh-configuration |
| 20762 | @end deffn | 20735 | Data type representing the configuration of @command{lshd}. |
| 20736 | |||
| 20737 | @table @asis | ||
| 20738 | @item @code{lsh} (default: @code{lsh}) (type: file-like) | ||
| 20739 | The package object of the GNU@tie{}lsh secure shell (SSH) daemon. | ||
| 20740 | |||
| 20741 | @item @code{daemonic?} (default: @code{#t}) (type: boolean) | ||
| 20742 | Whether to detach from the controlling terminal. | ||
| 20743 | |||
| 20744 | @item @code{host-key} (default: @code{"/etc/lsh/host-key"}) (type: string) | ||
| 20745 | File containing the @dfn{host key}. This file must be readable by | ||
| 20746 | root only. | ||
| 20747 | |||
| 20748 | @item @code{interfaces} (default: @code{()}) (type: list) | ||
| 20749 | List of host names or addresses that @command{lshd} will listen on. | ||
| 20750 | If empty, @command{lshd} listens for connections on all the network | ||
| 20751 | interfaces. | ||
| 20752 | |||
| 20753 | @item @code{port-number} (default: @code{22}) (type: integer) | ||
| 20754 | Port to listen on. | ||
| 20755 | |||
| 20756 | @item @code{allow-empty-passwords?} (default: @code{#f}) (type: boolean) | ||
| 20757 | Whether to accept log-ins with empty passwords. | ||
| 20758 | |||
| 20759 | @item @code{root-login?} (default: @code{#f}) (type: boolean) | ||
| 20760 | Whether to accept log-ins as root. | ||
| 20761 | |||
| 20762 | @item @code{syslog-output?} (default: @code{#t}) (type: boolean) | ||
| 20763 | Whether to log @command{lshd} standard output to syslogd. | ||
| 20764 | This will make the service depend on the existence of a syslogd service. | ||
| 20765 | |||
| 20766 | @item @code{pid-file?} (default: @code{#f}) (type: boolean) | ||
| 20767 | When @code{#t}, @command{lshd} writes its PID to the file specified in | ||
| 20768 | @var{pid-file}. | ||
| 20769 | |||
| 20770 | @item @code{pid-file} (default: @code{"/var/run/lshd.pid"}) (type: string) | ||
| 20771 | File that @command{lshd} will write its PID to. | ||
| 20772 | |||
| 20773 | @item @code{x11-forwarding?} (default: @code{#t}) (type: boolean) | ||
| 20774 | Whether to enable X11 forwarding. | ||
| 20775 | |||
| 20776 | @item @code{tcp/ip-forwarding?} (default: @code{#t}) (type: boolean) | ||
| 20777 | Whether to enable TCP/IP forwarding. | ||
| 20778 | |||
| 20779 | @item @code{password-authentication?} (default: @code{#t}) (type: boolean) | ||
| 20780 | Whether to accept log-ins using password authentication. | ||
| 20781 | |||
| 20782 | @item @code{public-key-authentication?} (default: @code{#t}) (type: boolean) | ||
| 20783 | Whether to accept log-ins using public key authentication. | ||
| 20784 | |||
| 20785 | @item @code{initialize?} (default: @code{#t}) (type: boolean) | ||
| 20786 | When @code{#f}, it is up to the user to initialize the randomness | ||
| 20787 | generator (@pxref{lsh-make-seed,,, lsh, LSH Manual}), and to create | ||
| 20788 | a key pair with the private key stored in file @var{host-key} | ||
| 20789 | (@pxref{lshd basics,,, lsh, LSH Manual}). | ||
| 20790 | |||
| 20791 | @end table | ||
| 20792 | @end deftp | ||
| 20763 | 20793 | ||
| 20764 | @cindex SSH | 20794 | @cindex SSH |
| 20765 | @cindex SSH server | 20795 | @cindex SSH server |
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index 7b038e6ac67..3baa55731df 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm | |||
| @@ -42,7 +42,7 @@ | |||
| 42 | #:use-module (ice-9 vlist) | 42 | #:use-module (ice-9 vlist) |
| 43 | #:export (lsh-configuration | 43 | #:export (lsh-configuration |
| 44 | lsh-configuration? | 44 | lsh-configuration? |
| 45 | lsh-service | 45 | lsh-service ; deprecated |
| 46 | lsh-service-type | 46 | lsh-service-type |
| 47 | 47 | ||
| 48 | openssh-configuration | 48 | openssh-configuration |
| @@ -74,20 +74,34 @@ | |||
| 74 | lsh-configuration? | 74 | lsh-configuration? |
| 75 | (lsh lsh-configuration-lsh | 75 | (lsh lsh-configuration-lsh |
| 76 | (default lsh)) | 76 | (default lsh)) |
| 77 | (daemonic? lsh-configuration-daemonic?) | 77 | (daemonic? lsh-configuration-daemonic? |
| 78 | (host-key lsh-configuration-host-key) | 78 | (default #t)) |
| 79 | (interfaces lsh-configuration-interfaces) | 79 | (host-key lsh-configuration-host-key |
| 80 | (port-number lsh-configuration-port-number) | 80 | (default "/etc/lsh/host-key")) |
| 81 | (allow-empty-passwords? lsh-configuration-allow-empty-passwords?) | 81 | (interfaces lsh-configuration-interfaces |
| 82 | (root-login? lsh-configuration-root-login?) | 82 | (default '())) |
| 83 | (syslog-output? lsh-configuration-syslog-output?) | 83 | (port-number lsh-configuration-port-number |
| 84 | (pid-file? lsh-configuration-pid-file?) | 84 | (default 22)) |
| 85 | (pid-file lsh-configuration-pid-file) | 85 | (allow-empty-passwords? lsh-configuration-allow-empty-passwords? |
| 86 | (x11-forwarding? lsh-configuration-x11-forwarding?) | 86 | (default #f)) |
| 87 | (tcp/ip-forwarding? lsh-configuration-tcp/ip-forwarding?) | 87 | (root-login? lsh-configuration-root-login? |
| 88 | (password-authentication? lsh-configuration-password-authentication?) | 88 | (default #f)) |
| 89 | (public-key-authentication? lsh-configuration-public-key-authentication?) | 89 | (syslog-output? lsh-configuration-syslog-output? |
| 90 | (initialize? lsh-configuration-initialize?)) | 90 | (default #t)) |
| 91 | (pid-file? lsh-configuration-pid-file? | ||
| 92 | (default #f)) | ||
| 93 | (pid-file lsh-configuration-pid-file | ||
| 94 | (default "/var/run/lshd.pid")) | ||
| 95 | (x11-forwarding? lsh-configuration-x11-forwarding? | ||
| 96 | (default #t)) | ||
| 97 | (tcp/ip-forwarding? lsh-configuration-tcp/ip-forwarding? | ||
| 98 | (default #t)) | ||
| 99 | (password-authentication? lsh-configuration-password-authentication? | ||
| 100 | (default #t)) | ||
| 101 | (public-key-authentication? lsh-configuration-public-key-authentication? | ||
| 102 | (default #t)) | ||
| 103 | (initialize? lsh-configuration-initialize? | ||
| 104 | (default #t))) | ||
| 91 | 105 | ||
| 92 | (define %yarrow-seed | 106 | (define %yarrow-seed |
| 93 | "/var/spool/lsh/yarrow-seed-file") | 107 | "/var/spool/lsh/yarrow-seed-file") |
| @@ -203,19 +217,20 @@ | |||
| 203 | (lsh-configuration-allow-empty-passwords? config)))) | 217 | (lsh-configuration-allow-empty-passwords? config)))) |
| 204 | 218 | ||
| 205 | (define lsh-service-type | 219 | (define lsh-service-type |
| 206 | (service-type (name 'lsh) | 220 | (service-type |
| 207 | (description | 221 | (name 'lsh) |
| 208 | "Run the GNU@tie{}lsh secure shell (SSH) daemon, | 222 | (extensions |
| 223 | (list (service-extension shepherd-root-service-type | ||
| 224 | lsh-shepherd-service) | ||
| 225 | (service-extension pam-root-service-type | ||
| 226 | lsh-pam-services) | ||
| 227 | (service-extension activation-service-type | ||
| 228 | lsh-activation))) | ||
| 229 | (description "Run the GNU@tie{}lsh secure shell (SSH) daemon, | ||
| 209 | @command{lshd}.") | 230 | @command{lshd}.") |
| 210 | (extensions | 231 | (default-value (lsh-configuration)))) |
| 211 | (list (service-extension shepherd-root-service-type | ||
| 212 | lsh-shepherd-service) | ||
| 213 | (service-extension pam-root-service-type | ||
| 214 | lsh-pam-services) | ||
| 215 | (service-extension activation-service-type | ||
| 216 | lsh-activation))))) | ||
| 217 | 232 | ||
| 218 | (define* (lsh-service #:key | 233 | (define-deprecated (lsh-service #:key |
| 219 | (lsh lsh) | 234 | (lsh lsh) |
| 220 | (daemonic? #t) | 235 | (daemonic? #t) |
| 221 | (host-key "/etc/lsh/host-key") | 236 | (host-key "/etc/lsh/host-key") |
| @@ -231,6 +246,7 @@ | |||
| 231 | (password-authentication? #t) | 246 | (password-authentication? #t) |
| 232 | (public-key-authentication? #t) | 247 | (public-key-authentication? #t) |
| 233 | (initialize? #t)) | 248 | (initialize? #t)) |
| 249 | lsh-service-type | ||
| 234 | "Run the @command{lshd} program from @var{lsh} to listen on port @var{port-number}. | 250 | "Run the @command{lshd} program from @var{lsh} to listen on port @var{port-number}. |
| 235 | @var{host-key} must designate a file containing the host key, and readable | 251 | @var{host-key} must designate a file containing the host key, and readable |
| 236 | only by root. | 252 | only by root. |
