diff options
| author | Patrick Norton <patrick.147.norton@gmail.com> | 2026-02-10 08:19:02 -0500 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-05-16 00:42:25 +0200 |
| commit | 89438b98fb8a23d7438d29df005f9127bcf399e6 (patch) | |
| tree | f12ef5ade4fd8d35b1b50a53fd35655e32e50cb7 /gnu/home | |
| parent | efe350639600c9a60cc7df2eea7116fcd0c53544 (diff) | |
gnu: home-services: Add config options to ssh.
* gnu/home/services/ssh.scm (openssh-host): Add new explicit
configuration options.
Change-Id: Ie67ed10829642cd1f64c55f25ccd50b8e557983e
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #6288
Diffstat (limited to 'gnu/home')
| -rw-r--r-- | gnu/home/services/ssh.scm | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/gnu/home/services/ssh.scm b/gnu/home/services/ssh.scm index 3f9d3cd3388..4fca0a71fbd 100644 --- a/gnu/home/services/ssh.scm +++ b/gnu/home/services/ssh.scm | |||
| @@ -70,6 +70,11 @@ | |||
| 70 | openssh-host-proxy-command | 70 | openssh-host-proxy-command |
| 71 | openssh-host-host-key-algorithms | 71 | openssh-host-host-key-algorithms |
| 72 | openssh-host-accepted-key-types | 72 | openssh-host-accepted-key-types |
| 73 | openssh-host-control-master | ||
| 74 | openssh-host-control-file-name | ||
| 75 | openssh-host-control-persist | ||
| 76 | openssh-host-sent-environment-variables | ||
| 77 | openssh-host-environment-variables | ||
| 73 | openssh-host-extra-content | 78 | openssh-host-extra-content |
| 74 | proxy-jump | 79 | proxy-jump |
| 75 | proxy-jump-host-name | 80 | proxy-jump-host-name |
| @@ -84,6 +89,9 @@ | |||
| 84 | (define (serialize-field-name name) | 89 | (define (serialize-field-name name) |
| 85 | (match name | 90 | (match name |
| 86 | ('accepted-key-types "PubkeyAcceptedKeyTypes") | 91 | ('accepted-key-types "PubkeyAcceptedKeyTypes") |
| 92 | ('sent-environment-variables "SentEnv") | ||
| 93 | ('environment-variables "SetEnv") | ||
| 94 | ('control-file-name "ControlPath") | ||
| 87 | (_ | 95 | (_ |
| 88 | (let ((name (let ((str (symbol->string name))) | 96 | (let ((name (let ((str (symbol->string name))) |
| 89 | (if (string-suffix? "?" str) | 97 | (if (string-suffix? "?" str) |
| @@ -130,6 +138,12 @@ | |||
| 130 | (define-maybe string) | 138 | (define-maybe string) |
| 131 | (define-maybe natural-number) | 139 | (define-maybe natural-number) |
| 132 | 140 | ||
| 141 | (define (serialize-symbol field value) | ||
| 142 | (string-append " " (serialize-field-name field) " " | ||
| 143 | (symbol->string value) "\n")) | ||
| 144 | |||
| 145 | (define-maybe symbol) | ||
| 146 | |||
| 133 | (define (serialize-raw-configuration-string field value) | 147 | (define (serialize-raw-configuration-string field value) |
| 134 | (string-append value "\n")) | 148 | (string-append value "\n")) |
| 135 | (define raw-configuration-string? string?) | 149 | (define raw-configuration-string? string?) |
| @@ -142,6 +156,33 @@ | |||
| 142 | 156 | ||
| 143 | (define-maybe string-list) | 157 | (define-maybe string-list) |
| 144 | 158 | ||
| 159 | (define (env-list? lst) | ||
| 160 | (string-list? lst)) | ||
| 161 | |||
| 162 | (define (serialize-env-list field lst) | ||
| 163 | (string-append " " (serialize-field-name field) " " | ||
| 164 | (string-join lst " ") "\n")) | ||
| 165 | |||
| 166 | (define-maybe env-list) | ||
| 167 | |||
| 168 | (define (string-alist? lst) | ||
| 169 | (and (list? lst) | ||
| 170 | (every (lambda (x) | ||
| 171 | (and (pair? x) | ||
| 172 | (string? (car x)) | ||
| 173 | (string? (cdr x)))) | ||
| 174 | lst))) | ||
| 175 | |||
| 176 | (define (serialize-string-alist field lst) | ||
| 177 | (string-append " " (serialize-field-name field) " " | ||
| 178 | (string-join | ||
| 179 | (map (match-lambda | ||
| 180 | ((key . value) | ||
| 181 | (format #nil "~a = ~s~%" (serialize-field-name key) value))) | ||
| 182 | lst) " ") "\n")) | ||
| 183 | |||
| 184 | (define-maybe string-alist) | ||
| 185 | |||
| 145 | (define-record-type <proxy-command> | 186 | (define-record-type <proxy-command> |
| 146 | (proxy-command command) | 187 | (proxy-command command) |
| 147 | proxy-command? | 188 | proxy-command? |
| @@ -275,6 +316,31 @@ through before connecting to the server.") | |||
| 275 | (accepted-key-types | 316 | (accepted-key-types |
| 276 | maybe-string-list | 317 | maybe-string-list |
| 277 | "The list of accepted user public key types.") | 318 | "The list of accepted user public key types.") |
| 319 | (control-master | ||
| 320 | maybe-symbol | ||
| 321 | "Enables the sharing of multiple sessions over a single network connection. | ||
| 322 | Acceptable values are @code{'no}, @code{'yes}, @code{'auto}, @code{'ask}, and | ||
| 323 | @code{'autoask}.") | ||
| 324 | (control-file-name | ||
| 325 | maybe-string | ||
| 326 | "The file name of the control socket used for connection sharing, or | ||
| 327 | @code{\"none\"} to disable connection sharing.") | ||
| 328 | (control-persist | ||
| 329 | maybe-string | ||
| 330 | "When used in conjunction with @env{control-master}, specifies that the | ||
| 331 | master connection should remain open in the background (waiting for future | ||
| 332 | client connections) after the initial client connection has been closed.") | ||
| 333 | (sent-environment-variables | ||
| 334 | maybe-env-list | ||
| 335 | "Specifies which variables from the local environment should be sent to the | ||
| 336 | server. The server must also support it, and the server must be configured to | ||
| 337 | accept those environment variables.") | ||
| 338 | (environment-variables | ||
| 339 | maybe-string-alist | ||
| 340 | "List of environment variables with corresponding values to send to the | ||
| 341 | server, as an alist of strings of the form @code{'(\"@var{variable}\" | ||
| 342 | . \"@var{value}\")}. The server must also support it, and the server must be | ||
| 343 | configured to accept those environment variables.") | ||
| 278 | (extra-content | 344 | (extra-content |
| 279 | (raw-configuration-string "") | 345 | (raw-configuration-string "") |
| 280 | "Extra content appended as-is to this @code{Host} block in | 346 | "Extra content appended as-is to this @code{Host} block in |
