scp with openssh on the server side and $PATH.

Jim Knoble jmknoble at pobox.com
Sat Dec 25 12:44:11 EST 1999


Hmm ... two solutions come to mind:

  (1) Allow a configuration item in /etc/ssh/sshd_config to specify the
      default PATH for connecting ssh sessions.  I'm not so familiar
      with the protocol, but it might even be possible to specify
      different PATHs for interactive/noninteractive ssh sessions.

  (2) Allow a configuration item in ~/.ssh/config to specify a PATH to
      pass to the remote shell.  The local scp would pass a command
      like `env PATH=x:y:z; scp ...' to execute the remote scp.  This
      is a bit trickier than [1], but does give control to the client.

I'll leave judgments on their elegance to someone besides me.  Perhaps
some combination of them would be practical....

-- 
jim knoble
jmknoble at pobox.com

På 1999-Dec-25 klokka 08:58:33 +1100 skrivet Damien Miller:

: This is a little tricky. When you execute scp, your local copy of
: scp executes another instance of scp on the server end.
: 
: The remote copy of scp could have been installed anywhere, and 
: there is little the client could do to the path (it could be 
: anywhere).
: 
: A possible solution would be to hardcode an explicit path at 
: configure time, but this would only work if the client and the
: server were configured the same. I am not keen to include this 
: kludge. (a more elegant solution would be welcomed, though).
: 
: Have you tried editing your /etc/profile (or similar) and simply
: including the path to scp in there?





More information about the openssh-unix-dev mailing list