I have found myself in typing out that long ssh command string every time when I need to connect our VPS server is not only boring but also time consuming. If you’re like me, you should also be tired of typing long ssh command strings in your day-to-day work. So, wouldn’t it be nice to have a shorter ssh string to save that extra key strokes?
Let us create an alias for the ssh command to make it shorter.
Fire up your terminal, then execute the following command to create an alias file in your home.
sudo nano ~/.bash_aliases
After creating the file, write our alias command for ssh into it. Make sure to choose an easy to remember name for the alias.
alias sshserver='ssh firstname.lastname@example.org'
save and close the file
Now, instead of executing ssh email@example.com to make an SSH connection, you can use the alias command sshserver