I am doing ssh to a Open SUSE linux server from windows cygwin. I am trying to send one of my local environment variable through the ssh command so that I can load some specific .bashrc file right after logging in. Here is what I have tried with.
Windows Machine has this env variable
IDENTITY=samiron
echo %IDENTITY%
samiron
In linux machine I have
vim /etc/ssh/sshd_config
AcceptEnv IDENTITY
In /home/user/.bashrc
I have written something like
export ME=$IDENTITY
My plan is to have a file like .bashrc.samiron
and do source ~/.bashrc.$ME
from .bashrc
file.
However, I am doing ssh like below and expecting the variable $ME
to contain "samiron"
ssh -o SendEnv=IDENTITY user@server.com
But after logging
user@server:~> echo $ME
Its shows nothing. Anyone can suggest me what I am doing wrong here?