How can I make
ssh admin@nas command work if
command is in
On my QNAP NAS File /root/.ssh/rc:
echo "old path is $PATH" export PATH=/opt/bin:/opt/sbin:$PATH echo "new path is $PATH"
on my machine:
~$ ssh admin@nas 'echo $PATH'
old path is /usr/bin:/bin:/usr/sbin:/sbin new path is /opt/bin:/opt/sbin:/usr/bin:/bin:/usr/sbin:/sbin /usr/bin:/bin:/usr/sbin:/sbin
so the path variable is not preserved. How can I achieve that?
As I mentioned in my comment below the command I'm trying to use is git or, more specific
git-receive-pack and probably some others. I want to use them in different locations and occasions and don't want to bother setting up a git config on every machine I use it on or teach my IDE how to communicate with my NAS but rather have my NAS conforming standards. So i figured that all I need is to set the right
what i did try so far was also inserting the
export PATH=... as well as adding another
echo (to verify they're run) to
to /etc/profile and to
~/.bashrc. Apparently none of them are even executed when I run a non-interactive command like above. If I do
ssh admin@nas all of them are executed, but that doesn't help