Tech Junkie Blog - Real World Tutorials, Happy Coding!: Iaas With AWS: Connect to EC2 Linux Instance On Linux Using SSH

Monday, August 17, 2020

Iaas With AWS: Connect to EC2 Linux Instance On Linux Using SSH

 In the previous post we created an EC2 instance in AWS in this post we are going to connect to that instance on a Linux workstation or server with SSH.

Here are the steps to connect to the EC2 instance using SSH on Linux, this will also work on a Mac as well:

1. Navigate to the folder that contains the key pair file that you've downloaded in the previous post, I store it in the folder /aws/EC2/KeyPair/ folder , so I would type cd /aws/EC2/KeyPair then type ls to see the file in the folder

2. Now before we can use the .pem file we have to change the permission first so that we don't get a permission denied error.  Type chmod 0400 IaasLinux.pem in the terminal.  By the way I sudo su to begin the session.  It's just much easier, then typing sudo all the time. You could also type chmod 400 as well.


3. Now go back to the AWS EC2 admin page to get the public DNS address of the instance so that you can use in the SSH connection command.  On the EC2 "Instances" under the "Descriptions" tab there's a public DNS and public IP.  You can use either one to connect to SSH I prefer the public DNS because it does not change.  Where as a public IP will change after a reboot, unless you have an Elastic IP.




4. You have to log into the instance as the ec2-user to get this to work, so type in the command
ssh -i IaasLinux.pem ec2-user@ec2-3-237-193-233.compute-1.amazonaws.com , type "yes" when asked if you want to continue now you connected to your EC2 instance on AWS


22 comments:

  1. This article is very useful. Very good article. Thank you for telling me about this article. I know of a school & fashion house that has a good education in fashion. best fashion design schools in accra Riohs Originate is a Creative Art Service and Training Institute in Ghana.
    They provide services and training for individuals/organizations that value their image, style, color and insist on promptness, accuracy and consistency.
    best fashion schools in accra ghana
    top fashion schools in accra
    fashion training schools in accra
    names of fashion schools in accra
    fashion design schools in accra ghana

    ReplyDelete
  2. Baby Frock Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post.

    ReplyDelete
  3. Baby girls frock Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome!

    ReplyDelete
  4. Frock for girls We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work.

    ReplyDelete
  5. Frock design This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free.

    ReplyDelete
  6. Frock This is my first visit to your web journal! We are a group of volunteers and new activities in the same specialty. Website gave us helpful data to work.

    ReplyDelete
  7. Frock style I like your post. It is good to see you verbalize from the heart and clarity on this important subject can be easily observed...

    ReplyDelete
  8. baby Frock design Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign.

    ReplyDelete
  9. Frock design for girls Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks

    ReplyDelete
  10. baby girl dresses Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too.

    ReplyDelete
  11. baby girls dresses Decent post! This is an exceptionally decent blog that I will absolutely return to more occasions this year! A debt of gratitude is in order for enlightening post.

    ReplyDelete
  12. Online shopping in Pakistan We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work.

    ReplyDelete
  13. bridal dresses I like your post. It is good to see you verbalize from the heart and clarity on this important subject can be easily observed...

    ReplyDelete
  14. fancy dress for girls Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign.

    ReplyDelete
  15. wedding dresses for girls Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks

    ReplyDelete
  16. wedding dresses Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too.

    ReplyDelete
  17. girls dresses Decent post! This is an exceptionally decent blog that I will absolutely return to more occasions this year! A debt of gratitude is in order for enlightening post.

    ReplyDelete
  18. dresses for girls Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks

    ReplyDelete
  19. Online Shopping for girls Decent post! This is an exceptionally decent blog that I will absolutely return to more occasions this year! A debt of gratitude is in order for enlightening post.

    ReplyDelete

Search This Blog