Fast Connection with SSH Aliases

If you need to regularly connect to a lot of different servers over SSH, this trick is for you.

Editing SSH configuration file and adding SSH aliases will make the process of the remote connection much more convenient.

Edit SSH configuration file for current user:

$ vi ~/.ssh/config

or edit the main configuration file, if you want to make this alias available for all users:

$ vi /etc/ssh/ssh_config 

Add the next lines:

###   Fast connection aliases   ###
Host AliasName
HostName 1.2.3.4
User YourUserName
Port YourSSHPort

Where:

  • Host – an alias for the target host;
  • HostName – a domain name or an IP address of the target host;
  • User – a user name for the ssh connection;
  • Port – an ssh port on the target host.

Now you can connect to the target host using simple alias:

$ ssh AliasName
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Start a GUI Application on a Remote Computer using SSH

This article describes how to log into the remote computer (server) using SSH and run a GUI...

SSH Login Slow — Removing Delay

Problem: When I’m trying to log into the remote server via SSH, after I enter the UserName, it...

SSHPass: SSH Login With Password – Command Line

A password-based authentication is often a default way to connect to a remote host over SSH. But...

Signing Failed: Agent Refused Operation [SOLVED]

While attempting to connect to some server over SSH, you may get the error as follows:...

SSH Fingerprint: Get Fingerprint of SSH RSA Key

The fingerprint is a unique sequence of letters and numbers used to identify the SSH RSA key. It...