This is the mail archive of the cygwin@cygwin.com 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: path problems when logged in through ssh


I had a similar problem with ssh.  In my case, I couldn't even log in
through ssh because the spawned child process could not find the cygwin
DLL.  The problem was that my system PATH value was longer than 512
characters.

The sshd daemon is supposed to copy its environment for the child
process.  Through debugging, I determined the child process did get a
copy of the daemon's environment -- except for PATH, which was set to
some useless default like /usr/sbin:/c/WINNT that didn't include the
cygwin directory.

I looked at the sshd sources and noticed a limit on the environment
value sizes of 512 in the code that copies the environment.  Since
shortening my system PATH value was not an option, I solved the problem
by overriding the PATH value for the sshd daemon's environment.  I did
this by editing the registry for my sshd service, but you can also do it
by recreating the sshd service with cygrunsrv and specifying the PATH
value as part of the service's environment.

Dave

"C. Porter Bassett" wrote:
> 
> Like I said in my original post, d:/cygwin/bin *IS* in my system path,
> but when I try to run something through ssh, it doesn't use the sytem
> path.
> 
> I did find the solution, which is to put /bin in my .bashrc.  I did not have
> it there because it was never needed before.  For some reason, now it is.
> 
> On Mon, Dec 17, 2001 at 11:22:29AM -0500, quoth the Larry Hall (RFK
> Partners, Inc):
> > At 04:01 PM 12/15/2001, C. Porter Bassett wrote:
> >
> >
> > Hm, I wonder how one would fix a problem where the path is set
> > incorrectly! ;-)
> >
> > Make sure you're path is set correctly by checking around in your
> > environment.  Most likely, your path is not set correctly in your
> > ~/.profile or something.  YMMV.
> 
> AND
> 
> On Mon, Dec 17, 2001 at 11:28:52AM -0500, quoth the Peter Buckley:
> > It sounds like D:\cygwin\bin is not in your system path. The location
> > of
> > the cygwin1.dll needs to be in your system path to run sshd as a
> > service.
> >
> > HTH,
> > Peter
> >
> > Larry Hall (RFK Partners, Inc) wrote:
> 
> > >When I ssh into my machine and try to run things installed in
> > >/usr/local/bin or /usr/sbin, windows pops up an error message saying "The
> > >dynamic link library cygwin1.dll could not be found in the specified path
> > >d:\cygwin\usr\local\bin;.;C:\WINNT\system32;C:\WINNTsystem;C\WINNT;."
> > >or if it is for a program installed in /usr/sbin, replace \local\bin with
> > >\sbin.
> > >
> > >Of course it doesn't find it in that path -- it's in d:\cygwin\bin, right
> > >where it should be.
> > >I do have d:\cygwin\bin in my path, but for some reason it doesn't look
> at
> > >the normal path when running stuff from sshd, it only looks in the above
> > >5 directories.
> 
> --
> 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/

--
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/


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