Setup SSH alias


This is easy tip. But I never knew in so many years.

Tip : How to open remote shell without typing the full server and user detail. Its like SSH alias.

Open the ssh folder.

cd /home/ganu/.ssh/
touch config
vi config

Then add the following lines in the config file

Host host1
  User=ganu
  Hostname=some.server.com
Host host2
  User=user2
  Hostname=some.host.server.com

Then save this file and just type

ssh host1

It will ask for password. And you are done.

Happy Bash.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: