- Newest
- Most votes
- Most comments
Step 1: Check if the ports are filtered or closed using the command:
$ sudo nmap -sS -sU -PN -p 22 <instance public ip>
If there are firewalls blocking the traffic, the output will look something like this:
$ sudo nmap -sS -sU -PN -p 22 8.8.8.8
Starting Nmap 7.80 ( https://nmap.org ) at 2023-04-02 17:16 UTC
Nmap scan report for dns.google (8.8.8.8)
Host is up.
PORT STATE SERVICE
22/tcp filtered ssh
22/udp open|filtered ssh
If this is the case, I believe there are OS level firewalls that are preventing the traffic on port 22. You can review the instance's Console Logs to check if there are any log entries such as:
Starting ufw..
.
.
ufw is running.
If the ports are Open
, then can you please provide more details as to how you are trying to login to the instance and what are the exact commands you are using. Also, please try logging in to the instance using terminal and command:
$ ssh -i <path_to_key_pair> ubuntu@<public_ip> -vvv
Based on the output, I will be able to make further suggestions to troubleshoot the issue.
Hope this helps.
Relevant content
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 2 years ago
To done this steps I need to access my screen ec2 connect tells error and using putty i can't open I don't have any other options then the management console access