Skip to content

5000+ Great Articles

Best Articles & Essays: Interesting Articles to Read Online

  • How to Fix Roku Error 003 Computer Tips
  • How To Batch Rename Files In Windows 10 Windows 10
  • Log Out of Multiple Websites at Once How-To
  • Latest Automated Social Media Tools Compared & Reviewed Tools Review
  • How to work the firestick Gadgets
  • Pokemon go tips and tricks 2021 technology
  • Use an iPad as a Second Monitor for PC or Mac Gadgets
  • Best ti83 graphing calculator 2020 Calculator

How to SSH to a Linux EC2 Instance from Mac

Posted on October 9, 2020 By bilal 1983 No Comments on How to SSH to a Linux EC2 Instance from Mac

For some time, Linux and its derivatives or distributions have been the most widely used platform in the cloud. Since many of these Linux instances are headerless, meaning they don’t have a graphical user interface (GUI), you need to access them through the command line.

In this post, we will show you how to connect to your Linux EC2 instance via SSH. We are using a Mac, so some of our screenshots will be taken from the Mac UI.

Source: https://thecloudmarket.com/stats#/by_platform_definition

How to SSH to a Linux EC2 Instance from Mac

SSH logins are typically done using public key authentication, which requires users to have a private key. While you can generate a public / private key pair using a third-party tool and then import the public key into Amazon EC2, we’re going to go the normal route of generating keys from Amazon EC2 itself. Now let me show you how this is done.

Generating keys in Amazon EC2

Sign in to the AWS Management Console.

How to SSH to a Linux EC2 Instance from Mac

Expand the All Services drop-down list and click EC2 under Calculations.

How to SSH to a Linux EC2 Instance from Mac

Scroll down the left sidebar until you reach the Network & Security section, and then click the Key Pairs menu.

How to SSH to a Linux EC2 Instance from Mac

Click the Generate Key Pair button.

How to SSH to a Linux EC2 Instance from Mac

Give the key pair a name and click the Create button.

How to SSH to a Linux EC2 Instance from Mac

Once a key pair is generated, its name will appear in the list of key pairs, and the private key will be automatically downloaded by your browser. Keep this private key file in a safe place and remember where you kept it as you will need it every time you connect to your Linux EC2 instance via SSH.

How to SSH to a Linux EC2 Instance from Mac

Before you can use this private key file, you need to change its permissions. Launch the Mac terminal from the Dock, or launch Mission Control (F4 key) and then go to Other Terminal.

How to SSH to a Linux EC2 Instance from Mac

Change to the directory containing your private key file and type:

chmod 400 nameofyourpravatekey.pem

How to SSH to a Linux EC2 Instance from Mac

You can now start using your private key to authenticate to your Amazon EC2 Linux instance over SSH.

I will not go into the details of creating a Linux EC2 instance as it should be owned by a separate post, but once you start such an instance, you will need to select the key pair you created so that Amazon EC2 knows which private key file is expected when connecting via SSH.

How to SSH to a Linux EC2 Instance from Mac

Once you start the instance, take note of its public DNS hostname or public IP address, as you will also need one of these when connecting via SSH.

To SSH into your EC2 instance from your Mac, simply go back to your terminal (or start it again if you’ve closed it already), navigate to the directory containing your private key file, and then type:

ssh – i ./nameofyourprivatekey.pem ec2-user @ ipaddress or hostname

For example (this is one line):

ssh -i ./myfirstkeypair.pem ec2-user@ec2-54-88-51-10.compute-1.amazonaws.com

After that, you should get something like the message below. Just enter yes.

Unable to authenticate host ec2-54-88-51-10.compute-1.amazonaws.com (54.88.51.10). ECDSA key fingerprint – SHA256: dDmWU5MGZhIxAVEajRTRLSQvQ1OIbVNy3Et1FInpKVg. Are you sure you want to continue connecting (yes / no)? yes

You should end up with something like this:

Warning: “ec2-54-88-51-10.compute-1.amazonaws.com, 54.88.51.10” (ECDSA) has been added to the list known hosts. -bash: warning: setlocale: LC_CTYPE: unable to change locale (UTF-8): no such file or directory [ec2-user @ ip-172-30-0 -93 ~] $

Once you see ec2-user @ the IP address of your ec2 instance as an invitation, you can start celebrating. You have successfully connected to your Linux EC2 instance via SSH.

How to SSH to a Linux EC2 Instance from Mac

Note. One common mistake is choosing the wrong key pair when starting an instance, so make sure that the private key you use when logging in over SSH and the key pair you selected earlier match. If they don’t match, you get something like:

Permission denied (publickey, gssapi-keyex, gssapi-with-mic)

We’re done here. See you next time. Enjoy!

Share this:

  • Facebook
  • X
How-To Tags:Generating keys in Amazon EC, How to SSH to a Linux EC2 Instance from Mac

Post navigation

Previous Post: How to Connect to a Windows EC2 Instance from Mac
Next Post: How to Create an Amazon S3 Bucket and Folder

Related Posts

  • How to Link a YouTube Video at a Specific Time on Mobile How-To
  • How To Have Your Computer Read Text Aloud How-To
  • How to Change Name of Your AirPods on Any Device How-To
  • How to Flush DNS Cache on Windows, macOS, Android, iOS How-To
  • iPhone Not Sending Text Messages? Here are 12 Ways to Fix It How-To
  • How to Install Third-Party Browsers On Chromebook How-To

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • March 2021
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • December 2019
  • July 2019
  • May 2019
  • April 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018

Categories

  • – 436
  • – 939
  • 1xBet giriş, güzgü 1 xBet Azərbaycanda rəsmi sayt – 413
  • AI Tools & Guides
  • Amazon Web Services
  • Apple Watch
  • blog
  • Calculator
  • Computer Tips
  • Cool Websites
  • Dasinmaz emlak elanlari, ev elanlari, ev alqi satqisi, kiraye evler, torpaq, obyekt, bina, bina ev, mənzil, villa, kreditle satilan evler – 814
  • Featured Posts
  • Free Software Downloads
  • Gadgets
  • Gaming
  • General Software
  • Google Software/Tips
  • Hardware
  • Help Desk
  • How-To
  • iOS
  • iPad
  • iPhone
  • islamic Books
  • Linux
  • Linux Tips
  • Mac OS X
  • macOS
  • MS Office Tips
  • Networking
  • Office Tips
  • OS X
  • Product Reviews
  • Reviews
  • Safari
  • Smart Home
  • Smartphones
  • Software Reviews
  • technology
  • text
  • Tools Review
  • Troubleshooting
  • Tutorial
  • Tutorials
  • Uncategorized
  • Urdu Books PDF
  • Web Site Tips
  • Windows
  • Windows 10
  • Windows 7
  • Windows XP Tips
  • Wordpress
  • бонусы до 250%, официальный сайт в Узбекистане – 69
  • Мостбет Уз Ставки на спорт и казино в букмекерской конторе Mostbet Uz – 527
  • ベラジョンカジノの出金方法一覧【2023年 最新】出金限度額・出金の流れ・出金手数料・出金条件 – 466
  • Mirror Your Android Screen to Any Computer With TeamViewer
  • Fixed macOS Error – You can’t open the application because it may be damaged or incomplete
  • Create a WiFi hotspot from Android which is already connected to WiFi
  • 11 LGBTQ+ flicks that premiered in 2020 > Taimi
  • 5 Effective ways to stay Anonymous on Android
DMCA.com Protection Status

Recent Posts

  • How to Download Torrents on Android
  • Mirror Your Android Screen to Any Computer With TeamViewer
  • Fixed macOS Error You can’t open the application
  • Create a WiFi hotspot from Android which is already connected to WiFi
  • Newyes A4 Portable Wireless Thermal Printer Review

Recent Comments

  1. Instagram stories not working/loading? Try These 9 Fixes on Can’t update PS5 system software? Try These 10 Fixes
  2. How to Link to a Specific Part Of A Webpage & Share it on Best PDF to Word Converter Online (Free Without Email)
  3. See What’s Taking up Space on Your Hard Drive on 7 best 3D scanning apps for Android and iOS
  4. Make your Devices Read Out Text, With Text to Speech on 9 Best 10K Running Apps for 2023
  5. How to Find your Router’s IP Address on How to Fix Apple CarPlay Not Working? 7 Possible ways
  • OTT Explains: What Is GOG Galaxy? Gaming
  • Windows 7 Screensaver and Power Options Not Working? Windows 7
  • How to Track GMail Emails on Android How-To
  • How to Use Checkboxes in Excel MS Office Tips
  • The Best Password Managers You Should Be Using Computer Tips
  • How to fix a fatal Javascript Discord error Help Desk
  • Best MP3 Tag Editors for Android, Windows, iOS and Mac How-To
  • How to use Windows 10X emulator on Windows 10 How-To

Copyright © 2023 How To Blog.

Powered by PressBook News WordPress theme

Go to mobile version