Troubleshoot problems connecting to your EC2 Linux instance using SSH (2024)

I can't connect to my Amazon Elastic Compute Cloud (Amazon EC2) Linux instance and want to troubleshoot the issue.

Resolution

Connect to the EC2 instance over SSH with verbose messaging on. Use the output messages from the SSH client to determine the type of issue. Or, you can connect to the instance using the EC2 Serial Console (Nitro-based and bare metal instances), or AWS Systems Manager Session Manager. Then, identify the error and use the links in the Troubleshoot common errors section to resolve the issue.

Connect to your instance to identify the issue

Connect using SSH

1.Connect to the EC2 instance over SSH with verbose messaging on:

user@localhost:~$ ssh -v -i my_key.pem [email protected]

This example uses my_key.pem for the private key file, and a username of [email protected]. Substitute your key file and your username for the example's key file and username. For more information, see Connect to your Linux instance using SSH.

2.Use the output messages from the SSH client to determine the type of issue you are experiencing.

Connect using the EC2 Serial Console for Linux on Nitro-based and bare metal instances

If you turned on the EC2 Serial Console for Linux, you can use it to troubleshoot supported Nitro-based instance types and bare metal instances. You can access the Amazon EC2 console or the AWS Command Line Interface (AWS CLI). You don't need a working connection to connect to your instance when you use the EC2 Serial console.

Note: If you haven't previously used the EC2 Serial Console, make sure that you review prerequisites and configure access before trying to connect.

1.Open the Amazon EC2 console.

2.Choose Instances.

3.Select the instance, then choose Actions, Monitor and troubleshoot, EC2 Serial Console, Connect.

or

Select the instance, then choose Connect,EC2 Serial Console, Connect.

An in-browser terminal window opens.

4.Press Enter. If you're connected to the serial console, then a login prompt returns. If the screen remains black, you can use the following information to help resolve issues with connecting to the serial console:

5.At the login prompt, enter the username of the password-based user that you set up previously, and then press Enter.

6.At the Password prompt, enter the password, and then press Enter.

You are now logged in to the instance and can use the serial console for troubleshooting.

Note: You can also connect using your own key and an SSH client.

For more information, see Connect to the EC2 Serial Console.

Connect using Session Manager

You can connect to your instance using AWS Systems Manager Session Manager. After connecting, you can run bash commands on the instance in the same way that you can with other connection methods.

Note: Before connecting using Session Manager, make sure that you complete the necessary set up steps. For more information, see Setting up Session Manager.

1.Open the Amazon EC2 console.

2.In the navigation pane, choose Instances.

3.Select the instance and choose Connect.

4.For Connection method, choose Session Manager.

5.Choose Connect.

For more information, see Connect to your Linux instance using Session Manager.

Troubleshoot common errors

Error: "Connection timed out" or "Connection refused": To resolve this error, see I'm receiving "Connection refused" or "Connection timed out" errors when trying to connect to my EC2 instance with SSH. How do I resolve this?

"connection timed out" errors on a virtual private cloud (VPC): To resolve this error, see How do I troubleshoot Amazon EC2 instance connection timeout errors from the internet?

Error: "Permission denied" or "Authentication failed": To resolve this error, see I'm receiving "Permission denied (publickey)" or "Authentication failed, permission denied" errors when trying to access my EC2 instance. How do I resolve this?

Error: "Server refused our key": To resolve this error, see Why am I getting a "Server refused our key" error when I try to connect to my EC2 instance using SSH?

Error: "imported-openssh-key" or "Putty Fatal Error": To resolve this error, see Why am I receiving "imported-openssh-key" or "Putty Fatal Error" errors when connecting to my Amazon Elastic Compute Cloud (Amazon EC2) Linux instance?

Error: "Enter passphrase for key 'my_key.pem'":

This error occurs if you created a password for your key file, but haven't manually entered the password. To resolve this error, enter the password or use ssh-agent to load the key automatically.

Automatically troubleshoot SSH errors

There are a number of reasons why you might get an SSH error, like Resource temporarily unavailable. Run the AWSSupport-TroubleshootSSH automation document to automatically find and resolve errors like this.

Related information

How do I troubleshoot issues connecting to my EC2 instance using EC2 Instance Connect?

How do I troubleshoot SSH or RDP connectivity to my EC2 instances launched in a Wavelength Zone?

Troubleshoot connecting to your instance

Troubleshoot problems connecting to your EC2 Linux instance using SSH (2024)
Top Articles
Bear market bottom and 10 sign to help you recognize it
Carrying Capital Losses Backward or Forward | 2023 TurboTax® Canada Tips
2018 Jeep Wrangler Unlimited All New for sale - Portland, OR - craigslist
Manhattan Prep Lsat Forum
Mopaga Game
Notary Ups Hours
The Wicked Lady | Rotten Tomatoes
World of White Sturgeon Caviar: Origins, Taste & Culinary Uses
12 Best Craigslist Apps for Android and iOS (2024)
Breakroom Bw
Flights To Frankfort Kentucky
Red Tomatoes Farmers Market Menu
978-0137606801
Best Suv In 2010
Simplify: r^4+r^3-7r^2-r+6=0 Tiger Algebra Solver
Violent Night Showtimes Near Amc Fashion Valley 18
Army Oubs
Unity - Manual: Scene view navigation
Wausau Marketplace
Erica Banks Net Worth | Boyfriend
How to Watch the Fifty Shades Trilogy and Rom-Coms
Woodmont Place At Palmer Resident Portal
How to Grow and Care for Four O'Clock Plants
Johnnie Walker Double Black Costco
E32 Ultipro Desktop Version
Vernon Dursley To Harry Potter Nyt Crossword
Speedstepper
Astro Seek Asteroid Chart
Mobile crane from the Netherlands, used mobile crane for sale from the Netherlands
Our Leadership
Imagetrend Elite Delaware
The Rise of "t33n leaks": Understanding the Impact and Implications - The Digital Weekly
Steven Batash Md Pc Photos
Panchitos Harlingen Tx
Go Upstate Mugshots Gaffney Sc
Avance Primary Care Morrisville
Mta Bus Forums
Hindilinks4U Bollywood Action Movies
Felix Mallard Lpsg
Insideaveritt/Myportal
Froedtert Billing Phone Number
2020 Can-Am DS 90 X Vs 2020 Honda TRX90X: By the Numbers
Aita For Announcing My Pregnancy At My Sil Wedding
Satucket Lectionary
Thothd Download
Ups Authorized Shipping Provider Price Photos
Joblink Maine
Motorcycles for Sale on Craigslist: The Ultimate Guide - First Republic Craigslist
Ouhsc Qualtrics
CPM Homework Help
German American Bank Owenton Ky
Emmi-Sellers
Latest Posts
Article information

Author: Ouida Strosin DO

Last Updated:

Views: 6315

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Ouida Strosin DO

Birthday: 1995-04-27

Address: Suite 927 930 Kilback Radial, Candidaville, TN 87795

Phone: +8561498978366

Job: Legacy Manufacturing Specialist

Hobby: Singing, Mountain biking, Water sports, Water sports, Taxidermy, Polo, Pet

Introduction: My name is Ouida Strosin DO, I am a precious, combative, spotless, modern, spotless, beautiful, precious person who loves writing and wants to share my knowledge and understanding with you.