Login ssh to server without including username

Let’s say you want to login to ssh in very short command. For instance,

ssh myserver

How to do it?

No configuration on server, just do some configuration on client side.
On client side terminal, open ssh config file. If it doesn’t exists, create a new one.
nano ~/.ssh/config

Then, type in following. 
host myserver
hostname myserverdomain.com
user myuser

And save it. No restart is required, just try ssh myserver, and you are login as myuser@myserverdomain.com


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s