0

Right now I have a network server that I frequently have to SSH into. Instead of typing:

ssh fox@192.168.2.24

I want to be able to say:

ssh fox@srv

And that it would SSH into the server at 192.168.2.24.

Is this possible, and if yes, how do I do that?

foxite
  • 451

1 Answers1

0

Thanks for @steeldriver for pointing me at this (and correcting me).

To do this:

  • Inside the .ssh folder in your home directory, create the file "config" if it doesn't exist.
  • Add this to the file:

    Host srv
      Hostname 192.168.2.24
    

This will make it possible to type ssh fox@srv instead of the whole address. You can also add:

User fox

To just type ssh srv.

See the man page for ssh_config for full details.

foxite
  • 451