7  Bonus: Making it easier to log in to the cluster

Learning Objectives:
Make logging in to Mantis easier

So far logging in to Mantis has required significant typing: ssh username@xanadu-submit-ext.cam.uchc.edu. We can make this a little bit easier! We can edit a configuration file to create a shortcut (or several shortcuts) to the Mantis login node or the transfer node.

7.0.1 The SSH config

Because you set up SSH-key based authentication to get into Mantis, you should have a hidden directory on your local machine called .ssh. In that directory will be your SSH keys.

For this we’ll work with a file in that directory that is simply called config.

Go to that directory now. If the file does not exist, create it with:

touch config

I’m going to suggest using nano to edit this file for now, but you can use any editor you like.

nano config

Then enter:

Host mantis
Hostname login.hpc.cam.uchc.edu
User <your username>
ForwardX11 yes
SetEnv LANG=en_US.UTF-8

Remember to subsitute <your username> for your own username.

mantis will be the name of the shortcut, you can change this if you want. You could cut it down to just m if you want to absolutely minimize typing.

Now you should be able to log in with ssh mantis.

You can set one of these up for the transfer node as well (this will work with scp and rsync:

Host transfer
Hostname transfer.hpc.cam.uchc.edu
User <your username>

And lastly, to prevent premature logouts

Host * ServerAliveInterval 180