Displaying 1 result from an estimated 1 matches for "ssh_server_host".
2013 Jun 08
4
"Virtual hosts" for ssh
...multiple installs of git on the same server, for example.
More details:
On the remote server, ssh already sets some environment variables:
> printenv | grep SSH
SSH_CLIENT=192.168.1.18 50945 22
SSH_TTY=/dev/pts/1
SSH_CONNECTION=192.168.1.18 50945 192.168.1.1 22
What about adding another, say
SSH_SERVER_HOST=host1
Assuming that /etc/hosts
192.168.1.1 host1 host2
then
ssh user at host1
and
ssh user at host2
would lead to a shell on the same host with the same user, but SSH_SERVER_HOST would be different, and that would allow the creation of a script that, for example, could find the correct git reposit...