Recommended Terminal Setup

From a Linux or MacOSX terminal

Run mkdir -p ~/.ssh/sockets and add the following lines to ~/.ssh/config on your machine (replacing <username> with your username):

Host *
    ControlMaster auto
    ControlPath ~/.ssh/sockets/ssh_mux_%h_%p_%r
    ControlPersist 1

Host mahuika
   User <username>
   Hostname login.mahuika.nesi.org.nz
   ProxyCommand ssh -W %h:%p lander
   ForwardX11 yes
   ForwardX11Trusted yes
   ServerAliveInterval 300
   ServerAliveCountMax 2

Host maui
   User <username>
   Hostname login.maui.nesi.org.nz
   ProxyCommand ssh -W %h:%p lander
   ForwardX11 yes
   ForwardX11Trusted yes
   ServerAliveInterval 300
   ServerAliveCountMax 2

Host lander
   User <username>
   HostName lander02.nesi.org.nz
   ForwardX11 yes
   ForwardX11Trusted yes
   ServerAliveInterval 300
   ServerAliveCountMax 2

Note: after creating the file ~/.ssh/config you should ensure the permissions are correct using  chmod 600 ~/.ssh/config.

This will allow you to run the command ssh mahuika (ssh maui) and bring you straight to Mahuika (Māui). With the Control directives, you will no longer have to type again your password with subsequent ssh or scp commands (recommended for data transfer). The ForwardX11 directives will enable X11 forwarding. The ServerAlive directives will stop the connection from hanging when you don’t type anything for some time. 

Was this article helpful?
0 out of 0 found this helpful