What is the effective SSH $PATH when executing a command
Hi all, I hope I'm in the right forum.
I have a cluster containing 32 compute nodes and 1 head node. I have a common user account which is being exported via the head node to all compute nodes - so all nodes can access the same files and "SHOULD" have the same environment as each other. I also have passwordless ssh and rsh setup between all nodes. As you will see if you examine the commands below there is something strange happening when ssh'ing. Essentially your effective permissions change when running a command over SSH. I can't figure out where its getting this alternate path variable from. The .bash_profile is shared between all nodes so they should have the same path when entering as that user (fluent). Any help on this would be greatly appreciated. I've exhausted all my local resources here at work and everyone is stumped. _________________________________________________ [fluent@colfax60 ~]$ ssh amd-1 echo $PATH /usr/ansys_inc/v120/fluent/bin:/opt/hpmpi/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/kerberos/sbin:/usr/kerberos/bin [fluent@colfax60 ~]$ ssh amd-1 'echo $PATH' /usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin [fluent@colfax60 ~]$ [fluent@colfax60 ~]$ ssh amd-1 which fluent which: no fluent in (/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin) [fluent@colfax60 ~]$ [fluent@colfax60 ~]$ ssh amd-1 Last login: Wed Feb 18 13:34:06 2009 from colfax60 [fluent@AMD-1 ~]$ which fluent /usr/ansys_inc/v120/fluent/bin/fluent [fluent@AMD-1 ~]$ _________________________________________________ |
Interactive vs. non-interactive
From the bash man page:
Quote:
|
I fixed this folks. Red Hat runs your profile vars like this - /etc/profile /etc/bashrc ~/.bashrc "OR" ~/.bash_profile
Something broke to where it wasn't running the ~/.bash_profile when ssh'ing under certain circumstances but when I added the desired path the ~/.bashrc for that user it all was peachy. Thanks and I hope this helps someone else down the road. |
Sorry I didn't see your post in time before my own response to resolve this, but thanks for the info! That is much help.
|
strange..
Ssh command uses path specified when building sshd Path should not be set in bashrc. If they are and exported: Ssh in and type 'bash' You might have everything doubled If they are but not exported: Create a file containing echo $PATH Execute it |
I always thought that running "ssh host command" would take on the permissions of whatever user you were executing the ssh command from. That's how its always worked for me. Then all of a sudden it wasn't working anymore.
|
I read the manpage and it says by default, ssh command will take the PATH used while building sshd. Kinda strange. Probably security reasons.
For the rest, I checked a RH and I confirm that it's the default settings, if you put things in .bashrc, you can get them defined multiple times. So it's cleaner in profile. |
Thanks for the info.
|
All times are GMT -5. The time now is 03:16 AM. |