SSH aliases

I was extremely tired of typing hostnames of the machines we are using at the office. I had these days when I ssh to a single machine 20 times. And I don’t want to remember names or IPs. Of course, you can generate private keys and passphrase but if you don’t have this option or knowledge, you can make SSH alias to a common server. Follow few easy steps:

Use you favorite text editor, I like MC:

mcedit ~/.ssh/config

In the config file add these lines (and put your server settings):

Host ALIAS_NAME
HostName IP_or_HOSTNAME
Port 22
User USERNAME

By typing in the terminal “ssh ALIAS_NAME” this will lead you to the password prompt of the server instantly.

2 thoughts on “SSH aliases

  1. Ha! Didn’t know you can do it that way. I always used to make aliases in my .bashrc that contain the full command. Thanks for the tip, bro! 🙂

    1. Well, I do know that there is way to do it but I have never logged that much on a single server. So I came up with this at the end.

Leave a Reply

Your email address will not be published. Required fields are marked *