X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <47B621B6.7BDECBCB@dessent.net> Date: Fri, 15 Feb 2008 15:35:18 -0800 From: Brian Dessent X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Windows System Variable with SSH References: <15507603 DOT post AT talk DOT nabble DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 . 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/