Hi I thought this was something that might concern the developers so I thought I'd post here. Apologies in advance if that's not the case. I'm setting up a CentOS cluster with OpenSSH_4.3p2 which uses ssh to launch processes on the remote nodes. I'm trying to use the SendEnv/AcceptEnv functionality to send the PATH environment variable from the headnode when users are launching jobs on remote nodes, since everything is cross-mounted and therefore in the same place. However, for some reason it's being overwritten on the remote nodes with some kind of default value, which I assume is compiled into the shell. Using verbose output I can see the client sending the vars, and if I create some test vars on the client and add them to the SendEnv/AcceptEnv statements in ssh_config/sshd_config, they are preserved in the remote environment, but PATH is not, and defaults to /usr/local/bin:/bin:/usr/bin, which is not very useful in this case. This occurs whether it's a login/non-login, interactive or non-interactive shell. At first I thought it might be an issue with PAM since I'm using LDAP to authenticate users, but it occurs with the root account also, which is obviously local. Can anyone shed any light on this? Many thanks Stuart Stuart Taylor School of Biological Sciences The University of Edinburgh Swann Building 3-34 Mayfield Road Edinburgh EH9 3JR -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
Stuart Taylor wrote: I thought this was something that might concern the developers so I thought I'd post here. Apologies in advance if that's not the case. I'm setting up a CentOS cluster with OpenSSH_4.3p2 which uses ssh to launch processes on the remote nodes. I'm trying to use the SendEnv/AcceptEnv functionality to send the PATH environment variable from the headnode when users are launching jobs on remote nodes, since everything is cross-mounted and therefore in the same place. If everything is mounted in the same place, why aren't the users getting the same shell rc file on the remote machine, and therefore the same PATH? You forgot to say what shell you're using, but bash seems to inherit the PATH even if it's run as a login shell. But I wouldn't depend on login to preserve the PATH, in fact I'd be surprised if it did. This is not an ssh issue.
On Wed, 31 Mar 2010, Stuart Taylor wrote: [...]> Using verbose output I can see the client sending the vars, and if I create some test vars on the client and add them to the SendEnv/AcceptEnv statements in ssh_config/sshd_config, they are preserved in the remote environment, but PATH is not, and defaults to /usr/local/bin:/bin:/usr/bin, which is not very useful in this case.Take a look at do_setup_env() in session.c That is where the server sets PATH Use the --with-default-path= and --with-superuser-path= configure options to build with the path you want. -- Tim Rice Multitalents (707) 887-1469 tim at multitalents.net