**This is an old revision of the document!**
Table of Contents
Aliases
by editing ~/.ssh/config, you can make SSH aliases very simply:
Host shortname HostName longname.domain.tld Port 22 User username
typing “ssh shortname” will be the same as “ssh username@longname.domain.tld” (even if shortname is not defined in the DNS nor in the /etc/hosts file)
Bounce hosts
Here we use a publicaly available IP host to reach a private host, using a single command. For this to work you have to add something like that in ~/.ssh/config:
Host hostname ProxyCommand ssh username@longname.domain.tld nc distant_private_ip_adress 22 User username
“ssh hostname” connects to the distantprivateip_adress adress server using the public longname.domain.tld host. Of course netcat must be installed on the public server.
Tunnels
We can map distant ports on localhost local ports, using a bounce host:
ssh -L 8080:server_to_forward_ports_of:80 server_to_connect_to
once connected to servertoconnectto, localhost:8080 would be the same as servertoforwardports_of:80.