diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2016-10-02 23:18:08 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2016-10-03 00:38:28 +0200 |
| commit | d8f3128119d32bcc186c8a1fe15b037bba25b4b8 (patch) | |
| tree | 3f0e9ade7c6af3faf685984e519a13a7c21b30c4 /gnu/services/ssh.scm | |
| parent | 92c03a871559590f7f3b0640e3a6cfd83c8044e6 (diff) | |
services: openssh-service-type: Expose 'openssh-configuration'.
* gnu/services/ssh.scm (<openssh-configuration>): Add default values.
[pubkey-authentication?]: Rename to...
[public-key-authentication?]: ... this.
(openssh-service): Remove.
* doc/guix.texi (Networking Services): Adjust accordingly.
Diffstat (limited to 'gnu/services/ssh.scm')
| -rw-r--r-- | gnu/services/ssh.scm | 51 |
1 files changed, 19 insertions, 32 deletions
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index 084f8fa4ea4..6da612da672 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm | |||
| @@ -50,7 +50,6 @@ | |||
| 50 | ;;; | 50 | ;;; |
| 51 | ;;; Code: | 51 | ;;; Code: |
| 52 | 52 | ||
| 53 | ;; TODO: Export. | ||
| 54 | (define-record-type* <lsh-configuration> | 53 | (define-record-type* <lsh-configuration> |
| 55 | lsh-configuration make-lsh-configuration | 54 | lsh-configuration make-lsh-configuration |
| 56 | lsh-configuration? | 55 | lsh-configuration? |
| @@ -261,15 +260,24 @@ The other options should be self-descriptive." | |||
| 261 | (define-record-type* <openssh-configuration> | 260 | (define-record-type* <openssh-configuration> |
| 262 | openssh-configuration make-openssh-configuration | 261 | openssh-configuration make-openssh-configuration |
| 263 | openssh-configuration? | 262 | openssh-configuration? |
| 264 | (pid-file openssh-configuration-pid-file) ;string | 263 | (pid-file openssh-configuration-pid-file |
| 265 | (port-number openssh-configuration-port-number) ;integer | 264 | (default "/var/run/sshd.pid")) |
| 266 | (permit-root-login openssh-configuration-permit-root-login) ;Boolean | 'without-password | 265 | (port-number openssh-configuration-port-number ;integer |
| 267 | (allow-empty-passwords? openssh-configuration-allow-empty-passwords?) ;Boolean | 266 | (default 22)) |
| 268 | (password-authentication? openssh-configuration-password-authentication?) ;Boolean | 267 | (permit-root-login openssh-configuration-permit-root-login ;Boolean | 'without-password |
| 269 | (pubkey-authentication? openssh-configuration-pubkey-authentication?) ;Boolean | 268 | (default #f)) |
| 270 | (rsa-authentication? openssh-configuration-rsa-authentication?) ;Boolean | 269 | (allow-empty-passwords? openssh-configuration-allow-empty-passwords? ;Boolean |
| 271 | (x11-forwarding? openssh-configuration-x11-forwarding?) ;Boolean | 270 | (default #f)) |
| 272 | (protocol-number openssh-configuration-protocol-number)) ;integer | 271 | (password-authentication? openssh-configuration-password-authentication? ;Boolean |
| 272 | (default #t)) | ||
| 273 | (public-key-authentication? openssh-configuration-public-key-authentication? | ||
| 274 | (default #t)) ;Boolean | ||
| 275 | (rsa-authentication? openssh-configuration-rsa-authentication? ;Boolean | ||
| 276 | (default #t)) | ||
| 277 | (x11-forwarding? openssh-configuration-x11-forwarding? ;Boolean | ||
| 278 | (default #f)) | ||
| 279 | (protocol-number openssh-configuration-protocol-number ;integer | ||
| 280 | (default 2))) | ||
| 273 | 281 | ||
| 274 | (define %openssh-accounts | 282 | (define %openssh-accounts |
| 275 | (list (user-group (name "sshd") (system? #t)) | 283 | (list (user-group (name "sshd") (system? #t)) |
| @@ -314,7 +322,7 @@ The other options should be self-descriptive." | |||
| 314 | #$(if (openssh-configuration-password-authentication? config) | 322 | #$(if (openssh-configuration-password-authentication? config) |
| 315 | "yes" "no")) | 323 | "yes" "no")) |
| 316 | (format port "PubkeyAuthentication ~a\n" | 324 | (format port "PubkeyAuthentication ~a\n" |
| 317 | #$(if (openssh-configuration-pubkey-authentication? config) | 325 | #$(if (openssh-configuration-public-key-authentication? config) |
| 318 | "yes" "no")) | 326 | "yes" "no")) |
| 319 | (format port "RSAAuthentication ~a\n" | 327 | (format port "RSAAuthentication ~a\n" |
| 320 | #$(if (openssh-configuration-rsa-authentication? config) | 328 | #$(if (openssh-configuration-rsa-authentication? config) |
| @@ -354,27 +362,6 @@ The other options should be self-descriptive." | |||
| 354 | (service-extension account-service-type | 362 | (service-extension account-service-type |
| 355 | (const %openssh-accounts)))))) | 363 | (const %openssh-accounts)))))) |
| 356 | 364 | ||
| 357 | (define* (openssh-service #:key | ||
| 358 | (pid-file "/var/run/sshd.pid") | ||
| 359 | (port-number 22) | ||
| 360 | (permit-root-login 'without-password) | ||
| 361 | (allow-empty-passwords? #f) | ||
| 362 | (password-authentication? #t) | ||
| 363 | (pubkey-authentication? #t) | ||
| 364 | (rsa-authentication? #t) | ||
| 365 | (x11-forwarding? #f) | ||
| 366 | (protocol-number 2)) | ||
| 367 | (service openssh-service-type (openssh-configuration | ||
| 368 | (pid-file pid-file) | ||
| 369 | (port-number port-number) | ||
| 370 | (permit-root-login permit-root-login) | ||
| 371 | (allow-empty-passwords? allow-empty-passwords?) | ||
| 372 | (password-authentication? password-authentication?) | ||
| 373 | (pubkey-authentication? pubkey-authentication?) | ||
| 374 | (rsa-authentication? rsa-authentication?) | ||
| 375 | (x11-forwarding? x11-forwarding?) | ||
| 376 | (protocol-number protocol-number)))) | ||
| 377 | |||
| 378 | 365 | ||
| 379 | ;;; | 366 | ;;; |
| 380 | ;;; Dropbear. | 367 | ;;; Dropbear. |
