How to SSH to AWS Elastic Beanstalk instance from ubuntu

I have used AWS Elastic Beanstalk cli to ssh and it worked like charm for me. I actually followed following guide to install the cli on my ubuntu:

Install AWS Elastic Beanstalk cli

Once the installation is done we are ready to init the elasticbean on ubuntu. I created a direction on my user's home directory with proper permission. Then I did the init using the following command

$ eb init

It initiated like below and I was set to run some eb command from my ubuntu setup.
drwxrwxr-x  2 beroza beroza 4096 May  9 16:14 .elasticbeanstalk
-rw-rw-r--  1 beroza beroza  108 May  9 16:09 .gitignore

If I need to see the web app running on my instance I can simply do this: 

$ eb open

If I need to see the console on my instance I can simply do this:
$ eb console 

Now to do the SSH on AWS Elastic Beanstalk instance I will need the .pem file provided by AWS. Copy the .pem file inside the .ssh direction of the Ubuntu. The file needs to have the permission 400 otherwise AWS will complain about bad permission. Once the permission is properly set we can simply run the following command to ssh toAWS Elastic Beanstalk instance.

$ eb ssh 

The instance name can be specified to for ssh like below:
$ eb ssh 

Comments