Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have added file with env.variable in .ssh/environment

How to restart ssh now, so this change will be reflected.

share|improve this question

~/.ssh/environment is read at login time. Just open another session after you have changed the file. If it is not working then you need to add into your sshd_config the following line: PermitUserEnvironment="yes" then restart sshd. To restart ssh you either have a ascript in /etc/init.d or you have svcs and svcadm command

You can also add your environment variables to ~/.login file. And if your default shell is bash you can add them to ~/.bashrc

share|improve this answer
I have added the entry in LD_LIBRARY_PATH in /.ssh/enviroment and modifed sshd_config and restarted the ssh using svcadm .. but after login env doesn't show the LD_LIBRARY_PATH value. – laks Mar 15 '10 at 13:11
Do not forget PermitUserEnvironment="yes" in sshd_config. It is no by default. This means that it is not reading your file. – Mircea Vutcovici Mar 15 '10 at 14:44
Do you have any reason why you are not using .login or .bashrc to change the environment? – Mircea Vutcovici Mar 15 '10 at 14:47
I'm trying to launch SSH without opening a session – laks Mar 17 '10 at 6:10

To restart the SSH service

svcadm restart ssh

however you may need to log in again (i.e. restart your session) to reload the environment variables.

share|improve this answer
I'm using solaris 10 ...seems like there is no "service command" available ... – laks Mar 15 '10 at 12:44
Thanks andy , i have restarted using svcadm – laks Mar 15 '10 at 13:04
I believe the service command is only on RHEL – warren Mar 15 '10 at 13:22
Not thinking entirely straight :) Answer updated – Andy Mar 15 '10 at 13:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.