Translation(s): none

This page will describe how to set up one or more SSH aliases. An SSH alias is a name used to refer to an SSH server or host on your network. If you have to run a lot of SSH comands, setting an alias can save you a lot of typing.


SSH aliases are configured on /etc/ssh/ssh_config (system-wide) or the the config file in $HOME/.ssh for user specific configuration.

You may need to create the user configuration file if it doesn't already exist:

mkdir .ssh
chmod 700 .ssh
touch .ssh/config


Let's say that you want to log into a machine. Normally you need to do

$ ssh mj2287@

but it gets boring quickly.

Adding that information to your config file will simplify and reduce the number of keystrokes.

Host webserver
   Port 2222
   User mj2278

Now, you can replace the command to:

% ssh webserver

Notes on the configuration

The most comprehensive information is in the man page of ssh_config, but the basics are:

The line starting with

There are many other configuration available and needed. Pay special attention to disallowing password authentication, and using public key authentication or certificate authentication only.

See also

SSH Config file at man 5 ssh_config ?ssh