Ubuntu – Simple Ubuntu scripts to connect to a server via terminal

terminalUbuntu

Im relatively new to Ubuntu, Im wondering how easy it is to write what I think is called a shell script to make tasks a little easier.

For example I frequently connect to a server – ssh -p 123 me@mysite.com

Can and how could I shorten this to a shorter command like "mysite" or "ssh mysite"

Thanks.

Best Answer

Alias is a quick and easy way, but a more secure one is to set up an ssh profile. In your ~/.ssh/config, put

Host mysite
Port 123
Hostname mysite.com
User me

Then you connect by just typing

ssh mysite
Related Topic