Hi,
I'd like to run commands via ssh, e.g.
ssh root@router "ifup wan"
This is what I get
[andrea@thinkpad ~]$ ssh root@router "ifup wan"
/sbin/ifup: 7: nvram: not found
This happens because the path is not set as when one logs in
[andrea@thinkpad ~]$ ssh root@router set
HOME='/tmp'
IFS='
'
LOGNAME='root'
OPTIND='1'
PATH='/usr/local/bin:/usr/bin:/sbin:/bin'
PPID='1946'
PS1='\w \$ '
PS2='> '
PS4='+ '
PWD='/tmp'
SHELL='/bin/ash'
USER='root'
This is when I log in
root@OpenWrt:~# set
HOME='/tmp'
IFS='
'
LOGNAME='root'
OPTIND='1'
PATH='/bin:/sbin:/usr/bin:/usr/sbin'
PPID='1948'
PS1='\u@\h:\w\$ '
PS2='> '
PS4='+ '
PWD='/tmp'
SHELL='/bin/ash'
TERM='xterm'
USER='root'
_='ll'
Basically /usr/sbin is missing
Other than setting PATH='/bin:/sbin:/usr/bin:/usr/sbin' before each command, does anybody know if it is possible to change it globally?
Thanks
