Env var for options/config

petesea at bigfoot.com petesea at bigfoot.com
Wed Apr 22 05:27:24 EST 2009


Is there any way to define openssh options via an env var?

Something like:

   SSH_OPTIONS='-oBatchMode=yes ...'

or

   SSH_CONFIG=/path/to/alternate/ssh_config

The reason I'd like to be able to use this is so I can override certain 
options without interfering with the users normal configuration file.  In 
the case of commands that indirectly call ssh, like cvs, there's no way to 
define specific options on the command line, so the only choices are to 
change the users ssh config file or create a wrapper script for ssh. 
Setting an environment variable is (IMO) just more clean and transparent.

If there isn't currently an environment variable, is there any chance this 
could be added in some future release?  If so, I think the "SSH_OPTIONS" 
env would be the most flexible, since you could always simulate the 
"SSH_CONFIG" approach using "SSH_OPTIONS=-F/path/to/config".

It would also provide a very easy way to help debug authentication issues 
with cvs, eg:

   $ SSH_OPTIONS='-v' cvs checkout ...


More information about the openssh-unix-dev mailing list