Login to remote instance with no pem file, just through your desired name!
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> email@example.com
Why not just type something like below being in any folder. Not providing any pem files, no IPs, just a simple command.
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.
Enter the details as below.
Host apimHostName 192.168.48.172User ubuntuIdentityFile /path/to/pemfile/name.pem
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,
You’ll be login to the instance in seconds!