Translation(s): none

This page will describe hot 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 through the config file in $HOME/.ssh. Create these if they don't already exist:

mkdir .ssh
touch .ssh/config

Let's say that a user bob wants to ssh into a machine whose IP address is and whose name is machina. Then he would add an entry like the following to config:


This assumes that bob's username on machina is also bob. And yes, the IP address really goes on the Hostname line.

Setting a static IP

As you can see, this "shortcut" is pretty worthless if machina gets its IP address through DHCP, because bob will have to edit his config file every time machina gets a new IP address.

See ?StaticIP to set static IP address for a given interface.


Now, bob can replace commands like:

% ssh bob@
% scp bob@ .


ssh machina
scp machina:~/file.txt .


See also

ssh_config(5) ?ssh