[Bug 2677] New: Provide a way to set an environment variable from ssh_config

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Thu Feb 16 04:52:02 AEDT 2017


https://bugzilla.mindrot.org/show_bug.cgi?id=2677

            Bug ID: 2677
           Summary: Provide a way to set an environment variable from
                    ssh_config
           Product: Portable OpenSSH
           Version: 7.4p1
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: ssh
          Assignee: unassigned-bugs at mindrot.org
          Reporter: sascha-openssh-bugs at silbe.org

For various purposes it's useful to pass some more or less fixed string
from the client to the server side. E.g. when forwarding sockets, the
remote socket name needs to include some string unique to the local
side (like the host name) to avoid collisions between connections from
different hosts. Think gpg-agent forwarding or using emacsclient on the
remote host to open the file (via TRAMP) on the local host.

This is currently possibly by using a wrapper script around ssh that
sets some environment variable, but setting an environment variable
directly in ssh_config would make things a lot smoother (no messing
with PATH required). Being able to expand environment variables and use
expansions like in the Match directive would be nice, but even a fixed
string would go a long way.

E.g.:
=== Begin .ssh/config ===
Host *.localdomain
   SetEnv EMACS_SOCKET=/home/sascha/.emacs.d/server/server.%l
   SetEnv GPG_AGENT_INFO=/home/sascha/.gnupg/S.gpg-agent.%l:1:1

Host myserver.localdomain
   RemoteForward
/home/sascha/.emacs.d/server/server.mydesktop:/tmp/emacs8193/server
   RemoteForward
/home/sascha/.gnupg/S.gpg-agent.mydesktop:/home/sascha/.gnupg/S.gpg-agent
=== End .ssh/config ===

(As you can see, environment variables and Match-like expansions would
be useful in RemoteForward as well, but that's a feature request for
another day).

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list