User specific hosts in Linux

hosts, linux, ssh

Solution

Don't create an alias. This is exactly what `ssh` config is for.

You can add a host alias in your `ssh` config in `~/.ssh/config`.

Example:

 Host foo
     HostName 172.16.254.1

Now when you type `ssh foo` it will execute `ssh 172.16.254.1`.

You can also add a user to the config. Example:

  Host foo
      HostName 172.16.254.1
      User bar

Problem

I want to ssh to a server, I have its IP address. It's suffering to remember it's IP, I want to ssh to it using a host name. But I have no authority to write the `/etc/hosts`. Is there a user specific hosts table that I have access to?

Original source