Java Ninja Chronicles By Norris Shelton

Things I learned in the pursuit of code

Your environment (env) isn’t the same environment you get when you ssh into a machine. It isn’t even the same environment you get when you rlogin into the same machine. Consider [sourcdcode language=”bash”]ssh host env[/sourcecode]. The list is much shorter.

To add to the ssh environment, modify

~/.ssh/environment

on the target host and add in the properties:

JAVA_HOME=$JAVA_HOME

Then turn on the ability to have a user defined ssh environment by modifying

/etc/ssh/sshd_config

Change “PermitUserEnvironment no” to “… yes”. You will then need to bounce the ssh service. It looks like the following commands should work:

/etc/init.d/sshd [restart | start | stop]

January 11th, 2011

Posted In: Bash, SSH

Leave a Comment

LinkedIn Auto Publish Powered By : XYZScripts.com