Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Tue, 18 Dec 2001 08:01:09 -0500 (EST) From: Prentis Brooks To: Karl M cc: Subject: Re: A Second OpenSSH Path Question In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII The difference is where the path is set. I am assuming that you are running sshd in the recommended method (out of cygrunsrv as system). cygrunsrv tacks on the cygwin primary paths after the windows System path, therefore any searches of similarly named executables will find the windows version first. That is why the non-interactive mode finds the 'find' under the windows dir. Now, when you login interactively, you are also invoking a full instance of the shell which also sources the /etc/profile and .bash_profile you may have. These in turn reset the path putting the Cygwin directories before the windows path. This is what I have concluded based on several tests that I have run. I have solved the problem by adding the following option to my cygrunsrv -I sshd -e PATH="/usr/local/bin:/usr/bin:/bin:$PATH" That forces the cygwin bin directories to precede any windows directory, since I generally do not want to run the windows binaries by default in an ssh session. If any of the maintainers know of a better solution or if I am wrong in my assessment, please correct me *grin* On Mon, 17 Dec 2001, Karl M wrote: > Hi All... > > I have a vanilla install on a Win2k, SP2 machine. > > If I type > > ssh localhost which find > > I get the one in /c/WINNT/System32 > > If I type > > ssh localhost > > and then type > > which find in the new session, I get the one in /usr/bin > > I know that I can change the setting of some environment variables to work > around this, but...My question is this: Why is remote command executution > different than remote interactive login? > > By the way, I have the Cygwin created profile in /etc in which the first > line is > > PATH="/usr/local/bin:/usr/bin:/bin:$PATH" > > So again, why do the two methods produce different results? > > Thanks, > > ...Karl > > > _________________________________________________________________ > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > -- > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > Bug reporting: http://cygwin.com/bugs.html > Documentation: http://cygwin.com/docs.html > FAQ: http://cygwin.com/faq/ > Prentis Brooks | prentis AT aol DOT net | 703-265-0914 | AIM: PrentisB Senior System Administrator - Web Infrastructure & Security A knight is sworn to valor. His heart knows only virtue. His blade defends the helpless. His word speaks only truth. His wrath undoes the wicked. - the old code of Bowen, last of the dragonslayers -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/