[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ssh and PATH trouble



On Sat, May 22, 1999 at 05:21:27PM +0200, Ramin Motakef wrote:
> Hi everybody!
> 
> I have some troble with ssh. I want to restart (or reload) services in
> /etc/init.d from a perl script. But what happens is:
> 
> root@nase[/root]# ssh  -x  vmdebian /etc/init.d/nfs-server reload 
> Reloading NFS servers configuration files.
> /etc/init.d/nfs-server: start-stop-daemon: command not found
> 
> So i did:
> 
> root@nase[/root]# ssh -x vmdebian echo $PATH

The $PATH is interpreted by your shell before being passed to ssh.
Quote it to get the $PATH variable ssh uses.

> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
> 
> wich seems ok for me.

>From ssh(1):

ENVIRONMENT
       Ssh will normally set the following environment variables:
[snip]
       PATH   Set to the default PATH, as specified when  compil-
              ing  ssh  or,  on some systems, /etc/environment or
              /etc/default/login.

HTH, Robert

-- 
Robert Vollmert                                      rvollmert@gmx.net


Reply to: