diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2017-12-04 23:31:15 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2017-12-04 23:31:15 +0100 |
| commit | aab322d909c0b4abec132ef7aff31c31a1208841 (patch) | |
| tree | 3cbe52ea12a1bedba2451ec746964aed36028035 | |
| parent | 39b27f4eae36d155faf466c59629afb5843030e6 (diff) | |
install: Don't start sshd by default.
Reported by Christopher Baines <mail@cbaines.net>
at <https://lists.gnu.org/archive/html/guix-devel/2017-12/msg00058.html>.
* gnu/services/ssh.scm (<openssh-configuration>)[%auto-start?]: New
field.
(openssh-shepherd-service): Honor it.
* gnu/system/install.scm (%installation-services): Set '%auto-start?' to
#f for openssh-service-type.
| -rw-r--r-- | gnu/services/ssh.scm | 12 | ||||
| -rw-r--r-- | gnu/system/install.scm | 5 |
2 files changed, 14 insertions, 3 deletions
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index b33ec946c6e..301ba740416 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm | |||
| @@ -304,7 +304,14 @@ The other options should be self-descriptive." | |||
| 304 | 304 | ||
| 305 | ;; list of user-name/file-like tuples | 305 | ;; list of user-name/file-like tuples |
| 306 | (authorized-keys openssh-authorized-keys | 306 | (authorized-keys openssh-authorized-keys |
| 307 | (default '()))) | 307 | (default '())) |
| 308 | |||
| 309 | ;; Boolean | ||
| 310 | ;; XXX: This should really be handled in an orthogonal way, for instance as | ||
| 311 | ;; proposed in <https://bugs.gnu.org/27155>. Keep it internal/undocumented | ||
| 312 | ;; for now. | ||
| 313 | (%auto-start? openssh-auto-start? | ||
| 314 | (default #t))) | ||
| 308 | 315 | ||
| 309 | (define %openssh-accounts | 316 | (define %openssh-accounts |
| 310 | (list (user-group (name "sshd") (system? #t)) | 317 | (list (user-group (name "sshd") (system? #t)) |
| @@ -445,7 +452,8 @@ of user-name/file-like tuples." | |||
| 445 | (provision '(ssh-daemon)) | 452 | (provision '(ssh-daemon)) |
| 446 | (start #~(make-forkexec-constructor #$openssh-command | 453 | (start #~(make-forkexec-constructor #$openssh-command |
| 447 | #:pid-file #$pid-file)) | 454 | #:pid-file #$pid-file)) |
| 448 | (stop #~(make-kill-destructor))))) | 455 | (stop #~(make-kill-destructor)) |
| 456 | (auto-start? (openssh-auto-start? config))))) | ||
| 449 | 457 | ||
| 450 | (define (openssh-pam-services config) | 458 | (define (openssh-pam-services config) |
| 451 | "Return a list of <pam-services> for sshd with CONFIG." | 459 | "Return a list of <pam-services> for sshd with CONFIG." |
diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 78f2bf3a139..0dd76886349 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm | |||
| @@ -264,7 +264,10 @@ You have been warned. Thanks for being so brave.\x1b[0m | |||
| 264 | ;; The root account is passwordless, so make sure | 264 | ;; The root account is passwordless, so make sure |
| 265 | ;; a password is set before allowing logins. | 265 | ;; a password is set before allowing logins. |
| 266 | (allow-empty-passwords? #f) | 266 | (allow-empty-passwords? #f) |
| 267 | (password-authentication? #t))) | 267 | (password-authentication? #t) |
| 268 | |||
| 269 | ;; Don't start it upfront. | ||
| 270 | (%auto-start? #f))) | ||
| 268 | 271 | ||
| 269 | ;; Since this is running on a USB stick with a overlayfs as the root | 272 | ;; Since this is running on a USB stick with a overlayfs as the root |
| 270 | ;; file system, use an appropriate cache configuration. | 273 | ;; file system, use an appropriate cache configuration. |
