Ssh – How to use sshd_config – PermitUserEnvironment option

ssh

I have client1 and client2 both are Linux machines.
From client1:

client1$ssh root@client2 "env"

It displays list of ssh variables from client2.

Things I did on client2:

I want to add new variable to client2 . So I edited sshd_config to

PermitUserEnvironment yes

and created a file environment under ssh with following entry

Hi=Hello

then restart sshd

/etc/init.d/sshd

Now from client1 trying the same command

client1$ssh root@client2 "env"

didn't provide the new variable Hi.

ref:

Best Answer

and created a file environment under ssh with following entry Hi=Hello

You should create the file /root/.ssh/environment on client2, assuming that /root is the home directory of root.