User Tools

Site Tools


This is an old revision of the document!

Better SSH experience

This page contains some suggestions on how to improve your SSH experience.

The ssh config file

You user own configuration file is located in your home folder at the path


In some cases this file does not exist, you can create it for example by issuing

touch ~/.ssh/config

This file is very useful to create ssh shortcuts to servers and add specific options for each server. In what follows I show some examples of how this can be used.

Speedup connection using tunneling

One can speedup logging in by configuring her/his own ssh client. This will also help in scp-ing data to the cluster.

The configuration example below shows how you can access a machine through another machine with a single ssh command. The scenario is as follows:

 User  --->  machine  ---->  machine ----> machine

And you want to use one single command to login to B or C.

# access
Host hostA
User <username on>
ForwardX11 yes  # this is equivalent to ssh -X
# directly access
Host hostB
User <Username on>
ForwardX11 yes
# Use this command if A uses Openssh server version < 5.4.
# It requires the program netcat (nc) to be installed on the
# machine.
ProxyCommand ssh -q nc 22
# directly access
Host hostC
User <Username on>
ForwardX11 yes
# Use this command if uses Openssh server version >= 5.4,
# that has native support for tunnelling ssh connections.
ProxyCommand ssh -q -W

Example: My user is florido. In the template above, I would change all the <Username …> to florido.

then to login to I will do:

ssh hostB

And I will have to input 2 passwords: one for, one for

In general you will have to input as many passwords as the number of hops. To overcome this problem, use a private/public ssh keypair technique described below.

Reduce passwords using a private/public ssh key pair

work in progress. If you plan to use this, read the following:




This tutorial is nice:

it_tips/ssh.1493803781.txt.gz · Last modified: 2017/05/03 09:29 by florido