Posted by Arjun on Friday 15th June 2018

How to create an SSH shortcut

How to ssh connect

In this post, I would like to show you a quick way to SSH into VMs. Using this approach you don't have to type  ssh -i ..etc every time. 

Let's open your ~/.ssh file and create a file called config and copy below shown text to it, 

Host app
    User ubuntu
    Port 22
    IdentityFile ~/.ssh/arjunphp-app.pem

Host jenkins
User ubuntu
IdentityFile ~/.ssh/arjunphp-jenkins.pem

If you get Permission denied issues,  change the file permission with below command:

 chmod 600 ~/.ssh/config

Sometime you might need to set  .pem file permissions to 600.