View Full Version : ssh profile/environment?

10-30-2006, 10:36 PM
I'm having trouble figuring out how to add environment variables a la .profile/.bash_profile to my ssh session.

bash doesn't seem to be sourcing .profile or .bash_profile.

Also tried creating a .ssh/environment but doesn't appear that this file is being read either.

Any suggestions?

10-31-2006, 02:49 AM
Try editing /.bashrc
All you need to do is add the line

export MYVAR="New value"

You can check that the variable is correctly defined next time you login by typing

echo $MYVAR

10-31-2006, 03:56 AM
Note that when you come in via SSH, your home directory is actually the / directory (not ~).
The /home/domain/.bashrc should be a link to /.bashrc
And, on the same lines, it is /.ssh/ that you need to add files to so that they are picked up by SSH (not /home/domain/.ssh ).