From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewbm5-00056j-Jc for guix-patches@gnu.org; Thu, 15 Mar 2018 18:55:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewbm2-00027N-G6 for guix-patches@gnu.org; Thu, 15 Mar 2018 18:55:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:55840) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ewbm2-00027D-Ba for guix-patches@gnu.org; Thu, 15 Mar 2018 18:55:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ewbm1-0005Tn-UT for guix-patches@gnu.org; Thu, 15 Mar 2018 18:55:01 -0400 Subject: [bug#30817] [PATCH] openssh-service: export AcceptEnv option Resent-Message-ID: References: <25eef45c-9acd-29ab-d82e-5dbc16909ef4@uni-bremen.de> <878tattg72.fsf@gnu.org> From: Martin Castillo Message-ID: <58584ce3-4561-5ffc-6434-b25dc0f7b62c@uni-bremen.de> Date: Thu, 15 Mar 2018 23:54:15 +0100 MIME-Version: 1.0 In-Reply-To: <878tattg72.fsf@gnu.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="d19Ecwbn0hyGlfrW7nqeGUPYWZVdWrQek" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 30817@debbugs.gnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --d19Ecwbn0hyGlfrW7nqeGUPYWZVdWrQek Content-Type: multipart/mixed; boundary="yCrLC7DwdU3nU1QNbfInSRkEkyrgEzfz3"; protected-headers="v1" From: Martin Castillo To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= Cc: 30817@debbugs.gnu.org Message-ID: <58584ce3-4561-5ffc-6434-b25dc0f7b62c@uni-bremen.de> Subject: Re: [bug#30817] [PATCH] openssh-service: export AcceptEnv option References: <25eef45c-9acd-29ab-d82e-5dbc16909ef4@uni-bremen.de> <878tattg72.fsf@gnu.org> In-Reply-To: <878tattg72.fsf@gnu.org> --yCrLC7DwdU3nU1QNbfInSRkEkyrgEzfz3 Content-Type: multipart/mixed; boundary="------------260EFD536DB8CB6DCF26BBD6" Content-Language: en-US This is a multi-part message in MIME format. --------------260EFD536DB8CB6DCF26BBD6 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, > Could you send an updated patch? Here you go --=20 GPG: 7FDE 7190 2F73 2C50 236E 403D CC13 48F1 E644 08EC --------------260EFD536DB8CB6DCF26BBD6 Content-Type: text/x-patch; name="0001-services-openssh-Add-accepted-environment-field.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0001-services-openssh-Add-accepted-environment-field.patch" =46rom 2cc779c3e0f02f7f58bed4bebfac92f94353cb3b Mon Sep 17 00:00:00 2001 From: Martin Castillo Date: Thu, 15 Mar 2018 23:40:58 +0100 Subject: [PATCH] services: openssh: Add 'accepted-environment' field. * gnu/services/ssh.scm ()[accepted-environment]: N= ew field. (openssh-config-file): Honor 'acccepted-environment'. * doc/guix.texi (Networking Services): Document it. --- doc/guix.texi | 16 ++++++++++++++++ gnu/services/ssh.scm | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index d3a7908f9..6e449b90c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11158,6 +11158,22 @@ server. Alternately, one can specify the @comma= nd{sftp-server} command: `(("sftp" ,(file-append openssh "/libexec/sftp-server")))))) @end example =20 +@item @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 +@code{man sshd_config(5)}. + +This example allows ssh-clients to export the @code{COLORTERM} variable.= =20 +It is set by terminal emulators, which support colors. You can use it i= n=20 +your shell's ressource file to enable colors for the prompt and commands= =20 +if this variable is set. +@example +(service openssh-service-type + (openssh-configuration + (accepted-environment '("COLORTERM")))) +@end 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 301ba7404..f1d2be3f6 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")))) =20 + ;; 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") =20 + (for-each (lambda (s) (format port "AcceptEnv ~a\n" s)) + '#$(openssh-configuration-accepted-environment conf= ig)) + (for-each (match-lambda ((name command) (format port "Subsystem\t~a\t~a\n" name co= mmand))) --=20 2.16.2 --------------260EFD536DB8CB6DCF26BBD6-- --yCrLC7DwdU3nU1QNbfInSRkEkyrgEzfz3-- --d19Ecwbn0hyGlfrW7nqeGUPYWZVdWrQek Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE61CTslYA+K5btSvb61vedmKoYVkFAlqq+aAACgkQ61vedmKo YVma3gf/Qrx5sfykzdmYKJBZq9QsHSaaLuk9iJCFGsuXK9DU7Jx/hyDmgaBUscgu h69YygYa+jP/sMrp/Pgb9Dyalp4H3CEeN5OminxJZ9LaDqVWSpfno5fIBM1BihoK WQX3P5UyMNABwlZpwgrLB3K5YgiNH+NEgz6YMO4vK+RP5PEVnRGzjk2yqWuwSsQ2 O1kg8/9hO7CVATp9LA4+JiyXpu+UWc6K843MgWu7/HVxQP0YHBu5J1fMHKWl+fKH FjFbYoE7Q2Gwb4nUIaUnBXT1faKMtQMOW+Co4GPy/A7AddaQCWuB33ucDZ7Sznkh kfcUBcxYozxX3p07wz701LpQ7EPDzQ== =Kt0Y -----END PGP SIGNATURE----- --d19Ecwbn0hyGlfrW7nqeGUPYWZVdWrQek--