mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
services: openssh: Add escape hatch.
* gnu/services/ssh.scm (<openssh-configuration>)[extra-content]: New field. * doc/guix.texi (Networking Services): Document it.
This commit is contained in:
parent
3d7ad1dc9f
commit
65cd70ce42
2 changed files with 23 additions and 0 deletions
|
@ -12644,6 +12644,19 @@ This is a symbol specifying the logging level: @code{quiet}, @code{fatal},
|
|||
@code{error}, @code{info}, @code{verbose}, @code{debug}, etc. See the man
|
||||
page for @file{sshd_config} for the full list of level names.
|
||||
|
||||
@item @code{extra-content} (default: @code{""})
|
||||
This field can be used to append arbitrary text to the configuration file. It
|
||||
is especially useful for elaborate configurations that cannot be expressed
|
||||
otherwise. This configuration, for example, would generally disable root
|
||||
logins, but permit them from one specific IP address:
|
||||
|
||||
@example
|
||||
(openssh-configuration
|
||||
(extra-content "\
|
||||
Match Address 192.168.0.1
|
||||
PermitRootLogin yes"))
|
||||
@end example
|
||||
|
||||
@end table
|
||||
@end deftp
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
;;; Copyright © 2016 David Craven <david@craven.ch>
|
||||
;;; Copyright © 2016 Julien Lepiller <julien@lepiller.eu>
|
||||
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
|
||||
;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -323,6 +324,12 @@ (define-record-type* <openssh-configuration>
|
|||
(log-level openssh-configuration-log-level
|
||||
(default 'info))
|
||||
|
||||
;; String
|
||||
;; This is an "escape hatch" to provide configuration that isn't yet
|
||||
;; supported by this configuration record.
|
||||
(extra-content openssh-configuration-extra-content
|
||||
(default ""))
|
||||
|
||||
;; list of user-name/file-like tuples
|
||||
(authorized-keys openssh-authorized-keys
|
||||
(default '()))
|
||||
|
@ -471,6 +478,9 @@ (define (openssh-config-file config)
|
|||
(match-lambda
|
||||
((name command) (format port "Subsystem\t~a\t~a\n" name command)))
|
||||
'#$(openssh-configuration-subsystems config))
|
||||
|
||||
(format port "~a\n"
|
||||
#$(openssh-configuration-extra-content config))
|
||||
#t)))))
|
||||
|
||||
(define (openssh-shepherd-service config)
|
||||
|
|
Loading…
Reference in a new issue