guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/09: services: openssh: Add 'accepted-environment' field.


From: Ludovic Courtès
Subject: 02/09: services: openssh: Add 'accepted-environment' field.
Date: Sat, 17 Mar 2018 19:02:37 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 985934cb218eaa44b255cfc464b11ce05f691973
Author: Martin Castillo <address@hidden>
Date:   Thu Mar 15 23:40:58 2018 +0100

    services: openssh: Add 'accepted-environment' field.
    
    * gnu/services/ssh.scm (<openssh-configuration>)[accepted-environment]: New 
field.
    (openssh-config-file): Honor 'acccepted-environment'.
    * doc/guix.texi (Networking Services): Document it.
    
    Signed-off-by: Ludovic Courtès <address@hidden>
---
 doc/guix.texi        | 17 +++++++++++++++++
 gnu/services/ssh.scm |  7 +++++++
 2 files changed, 24 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index bcea89e..b768b20 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -11158,6 +11158,23 @@ server.  Alternately, one can specify the 
@command{sftp-server} command:
            `(("sftp" ,(file-append openssh "/libexec/sftp-server"))))))
 @end example
 
address@hidden @code{accepted-environment} (default: @code{'()})
+List of strings describing which environment variables may be exported.
+
+Each string gets on its own line.  See the @code{AcceptEnv} option in
address@hidden sshd_config}.
+
+This example allows ssh-clients to export the @code{COLORTERM} variable.
+It is set by terminal emulators, which support colors.  You can use it in
+your shell's ressource file to enable colors for the prompt and commands
+if this variable is set.
+
address@hidden
+(service openssh-service-type
+         (openssh-configuration
+           (accepted-environment '("COLORTERM"))))
address@hidden example
+
 @item @code{authorized-keys} (default: @code{'()})
 @cindex authorized keys, SSH
 @cindex SSH authorized keys
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm
index 301ba74..f1d2be3 100644
--- a/gnu/services/ssh.scm
+++ b/gnu/services/ssh.scm
@@ -302,6 +302,10 @@ The other options should be self-descriptive."
   (subsystems            openssh-configuration-subsystems
                          (default '(("sftp" "internal-sftp"))))
 
+  ;; list of strings
+  (accepted-environment  openssh-configuration-accepted-environment
+                         (default '()))
+
   ;; list of user-name/file-like tuples
   (authorized-keys       openssh-authorized-keys
                          (default '()))
@@ -430,6 +434,9 @@ of user-name/file-like tuples."
            (format port "AuthorizedKeysFile \
  .ssh/authorized_keys .ssh/authorized_keys2 /etc/ssh/authorized_keys.d/%u\n")
 
+           (for-each (lambda (s) (format port "AcceptEnv ~a\n" s))
+                     '#$(openssh-configuration-accepted-environment config))
+
            (for-each
             (match-lambda
               ((name command) (format port "Subsystem\t~a\t~a\n" name 
command)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]