Forum Discussion
swiss2000_13853
Nimbostratus
Feb 24, 2010SSH and $PATH
Hi all
I'd like to run some commands on my LTM (10.0.1) via ssh. Problem is that these commands located in a directory which is not in the $PATH:
$ssh user@f5ltm.company.com 'testcmd'
bash: testcmd: command not found
$ssh user@f5ltm.company.com 'echo $PATH'
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
Does anybody know how to modify this PATH for SSH-Logins without shell exec?
I also tried the following setting in the sshd_config:
PermitUserEnvironment yes
and created a ~/.ssh/environment file with the PATH definition. That also didn't work.
Any other ideas?
Regards
Marc
- L4L7_53191
Nimbostratus
I've not looked at it in a long while but I would try adding something like export PATH=$PATH:/your/dir/here to the root .bashrc file. I wouldn't mess with /etc/profile here, as it's liable to get clobbered on upgrade... - swiss2000_13853
Nimbostratus
Hi Matt - hwidjaja_37598
Altostratus
Marc, - hoolio
Cirrostratus
Nice one... - L4L7_53191
Nimbostratus
I would expect that the .bashrc gets correctly sourced on its own, but after looking at this there's a bit more going on. As expected ~/.bashrc gets sourced automatically when you're in an interactive shell. When you hit the box in non-interactive mode, you're getting trumped by /etc/bashrc, which calls a function called pathmunge (!) that is changing the path for non-interactive shell access. - Mark_Crosland_2Historic F5 Account
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects