I'd like to know how to make the remote user name available in an ssh session on my server. So when joe@host1
logs in as commonuser@server1
, the scripts running on server1
running as commonuser
will know that the person running them is actually joe
.
I tried
SendEnv
/AcceptEnv
without luck. I even looked at SSH debug output and it looked like the environment variable was sent, but when I doecho $REMOTE_USER
I see empty string.
I would also like this to be working even if
joe
is less cooperative, for example when he refuses to set theREMOTE_USER
variable.