Question

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?

Was it helpful?

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top