How to easily ssh by binding ip address

Ting-Hao Chen
Programming Notes
Published in
1 min readJul 27, 2018

Bind IP address with simple name when ssh to remote server!

This how-to is simple and will save your daily time if you are still typing IP address every time you use ssh.

I need to connect many servers everyday. Since remembering those IP addresses are very hard for me, and typing those IP addresses is like nightmare. So here is the step-by-step how to change those IP addresses to easily memorize name.

I’ll use macOS as example and demonstrate on terminal.

Step 1. Go to the directory under .ssh and create a file “config” if you don’t have.

(bash)$ cd ~/.ssh
(bash)$ touch config

Step 2. Now edit the config file.

Note: Some basic vim tutorials.
Press “a” to start edit.
Press “esc” to end edit.
Press “:” and enter “wq” to write the file and quit.

(bash)$ vim config

Step 3. Past the commands below in the config file. After editing, write and quit the config file.

Host <Name>
HostName <real IP address or hostname here>
User <username>

For example:
name: AWS_001, IP: 127.0.0.1, username: user

Host AWS_001
HostName 127.0.0.1
User user

That’s it! Now try it!

(bash) $ ssh AWS_001

--

--