Quantcast
Viewing all articles
Browse latest Browse all 2

Answer by Sven for Properly implement REMOTE_USER-like thing for ssh

If you want to connect multiple remote persons to the same local user account, you should use SSH keys and have each user use their own key.

This allows you to identify the key used to login (see this question for more details). Without keys, you can't identify the remote user at all.

If you set PermitUserEnvironment=yes in /etc/ssh/sshd_config, you then can also force an environment variable in the ~/.ssh/authorized_keys file like so:

cat ~/.ssh/authorized_keys

environment="REMOTE_USER=joe@remote1" ssh-dss AAAAB3Nza......

(See man sshd for more information about authorized_keys and man sshd_config).


Viewing all articles
Browse latest Browse all 2

Trending Articles