I spend most of my day ssh'd into servers. I have a series of aliases/functions/scripts that allow me to type
p hostname from the terminal and execute GNU screen(1) on the remote side, using the following command:
exec ssh hostname -t 'screen -RD'`
I've only recently noticed that
ssh -t does not get my custom
$PATH. Here's some terminal output:
adam@workstation:~:0$ sh server 'echo $PATH' /home/adam/bin:/usr/local/bin:/bin:/usr/bin:/opt/git/bin:/opt/git/libexec/git-core adam@workstation:~:0$ ssh server -t 'echo $PATH' /usr/local/bin:/bin:/usr/bin Connection to uranus.plymouth.edu closed.
My biggest problem is my custom aliases only try to execute
screen, since I can't guarantee an absolute path, and my
$PATH is structured so the shell should find the correct one. If my
$PATH settings aren't honored, my scripts don't work. Is there a way I can use
$PATH as defined by my
PermitUserEnvironment is disabled.