A problem with PATH in sshd.c

David Bartl bartl at ss1000.ms.mff.cuni.cz
Thu Feb 24 19:06:28 EST 2000


	Dear Sirs,

on my Linux (distribution Slackware 3.9), I have installed the
``openssh-1.2.2.tar.gz'' package into the /usr/local/bin directory.

In the ``sshd.c'' file, the PATH variable is set up:

	child_set_env(&env, &envsize, "PATH", _PATH_STDPATH);

(line no. 2405).  I am unable to connect to my machine using scp.
_PATH_STDPATH is "/usr/bin:/bin:/usr/sbin:/sbin", but the scp program
dwells in /usr/local/bin.  If I try to connect, enter password (etc.,
all OK), then the shell reports it could not find the scp command (not
in PATH) and the connection is closed...

IMHO, an ordinary user does not need to have "/usr/sbin:/sbin" in
his/her PATH.
IMHO, the PATH variable should be set to _PATH_DEFPATH, which is 
"/usr/local/bin:/usr/bin:/bin":

	child_set_env(&env, &envsize, "PATH", _PATH_DEFPATH);

I have changed it, recompiled the sshd and everything works fine.

Yours faithfully
David Bartl






More information about the openssh-unix-dev mailing list