Login to remote instance with no pem file, just through your desired name!

Image for post
Image for post

When you login to a remote instance, isn’t it hard to remember where your pem file is stored? Always navigating to the specific folder? Always typing and keep remembering the IPs?

Don’t you feel pain to always type,

ssh -i </path/to/pem/file/pemfile.pem> ubuntu@

Why not just type something like below being in any folder. Not providing any pem files, no IPs, just a simple command.

ssh apim

It’s just easy as typing the above command.

Open your localhost terminal, navigate to ~/.ssh folder and enter the details about the instance to the config file.

cd ~/.ssh
vi config

Enter the details as below.

Host apim

Host: Any name you like to login with.

HostName: IP address of the host.

IdentityFile: Path and the name of the pem file.

All done. Now just open the terminal and type,

ssh apim

You’ll be login to the instance in seconds!

Written by

Senior Software Engineer — QA at WSO2

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store