Saturday, November 15, 2014

Accessing Servers by Hostname Instead of IP Address

Prerequisites: This guide was written for Mac OS X and Linux Ubuntu users.

If you're still SSH'ing into your servers by IP address, here's a tip that will make your life a whole lot easier. First, you'll need to store your server's IP address in your /etc/hosts file like so:

# Host Database
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
## localhost server

In the above example, would be replace by an actual IP address, and "server" would be the hostname of that server. You can name it whatever you want, really.

Now you can ssh with ssh user@server instead of ssh user@ from here on.

No comments:

Post a Comment