PATH in SSH
I am using Centos 6.x
When I ssh to a server and try to use an executable software, I have to use PATH=$PATH/location_of_software/ When I check the usre's PATH, in the .bash_profile file, this line already exist. How can I permanently set the PATH for SSH user? |
Are you using ssh direct to that user account, or switching user after log in? I'm thinking either you need the "su -" specifically with the "-" switch to force .bash_profile, or there is a typo somewhere in the .bash_profile script.
|
Replay to joec@home:
I am using ssh direct to the user account. if switch to su - then everything works. |
I think ssh does not use .bash_profile directly (because it is not an interactive shell - see man bash, invocation), so you need explicitly do that:
Code:
ssh user@host 'source ~/.bash_profile; your_app' |
Quote:
|
Quote:
Code:
$ ssh host command Code:
$ ssh host |
All times are GMT -5. The time now is 07:43 AM. |