I was building OpenSSH on a Solaris 2.6 machine and found a small problem using scp after it was built. The scp command coming from a remote machine to the OpenSSH machine results in an error message of "sh: scp: not found". The start-up script for sshd sets PATH to include /usr/local/bin where scp resides. I also tried adding an "export PATH" in case that was the problem, but the error persisted. I also added /usr/local/bin to the PATH in the .login for root. I also did the same for each individual user. I could solve the problem by linking /usr/local/bin/scp to /usr/bin/scp, but this seems a fairly ugly solution. Do you have any idea why the PATH variable is not picked up sshd (either from root's PATh or the target user's PATH)? Thanks for any input. Andrew Sherrod
mouring at etoh.eviladmin.org wrote:> Have you tried recompiling with --with-default-path= and ensure that > /usr/local/bin is within that path? >On Solaris 7, this solved the similar problem I had. I think sshd resets PATH and sets it on its own throwing away the environment setting. Whether having sshd use /usr/local/bin as part of its search PATH is cleaner than having a single symlink /usr/bin/scp -> /usr/local/bin/scp is a matter of question. I chose the --with-default-path setting after pondering for a while. ishikawa
Have you tried recompiling with --with-default-path= and ensure that /usr/local/bin is within that path? On Mon, 22 Jan 2001, Sherrod, Andrew wrote:> I was building OpenSSH on a Solaris 2.6 machine and found a small problem > using scp after it was built. > > The scp command coming from a remote machine to the OpenSSH machine results > in an error message of "sh: scp: not found". The start-up script for sshd > sets PATH to include /usr/local/bin where scp resides. I also tried adding > an "export PATH" in case that was the problem, but the error persisted. > > I also added /usr/local/bin to the PATH in the .login for root. I also did > the same for each individual user. > > I could solve the problem by linking /usr/local/bin/scp to /usr/bin/scp, but > this seems a fairly ugly solution. > > Do you have any idea why the PATH variable is not picked up sshd (either > from root's PATh or the target user's PATH)? > > Thanks for any input. > > Andrew Sherrod >
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1> > Have you tried recompiling with --with-default-path= and ensure that > > /usr/local/bin is within that path? > > On Solaris 7, this solved the similar problem I had. > I think sshd resets PATH and sets it on its own > throwing away the environment setting.You could set PATH in $HOME/.ssh/environment - I belive this gets read after the environment is "normalized", but just before the command or shell is run. I agree that the better solution is for configure to include $PREFIX/bin in the default path. -Jason --------------------------- If the Revolution comes to grief, it will be because you and those you lead have become alarmed at your own brutality. --John Gardner -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: See https://private.idealab.com/public/jason/jason.gpg iD8DBQE6bMKkswXMWWtptckRAhmUAKC5eA1AXt0f97cCJ9Mcx893RF3VeACeODoS 1qnrb4G17lInYIcZGmnWyxI=+V9I -----END PGP SIGNATURE-----