This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Windows System Variable with SSH


dnbphysicist wrote:

> We have an open ssh client installed on one of our Windows 2003 servers, and
> are able to login in and everything, but when issuing commands some the
> System Paths (which are in .bat files on the server) such as %JAVA_HOME% are
> not recognized. I assume this is because Cygwin does not know how to

If you're executing a batch file, then Cygwin is not involved at all
becaue CMD.EXE parses and executes batch files.  So that's not the
problem.

> interpret the % signs. Is there anyway to get Cygwin to recognize the system
> variables with the % signs around them.

The problem is that the ssh daemon starts with a clean (empty)
environment when setting up the session and only allows a certain
hardcoded list of allowed variables to be inherited.  See
<http://cygwin.com/ml/cygwin/2006-11/msg00397.html>.  This is a security
feature, so that it's impossible to accidently leak a variable from the
root session that started the daemon to the client session.

You should eliminate the batch file from the equation just to simpify
things; just ssh in and look at what environment variables are set, and
I think you will find that JAVA_HOME is simply not set.  If you want it
to be set, you need to set it explicitly in the shell startup files
(/etc/profile, ~/.bash_profile, ~/.profile, etc.) as you would on *nix,
rather than letting it be inherited from the parent process or set by
the system.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]