Ssh port connection error

0

i started the ubuntu image instance with ssh port in amazon ec2 and i installed jenkins with related packages after installation it requires the tcp 8080 port so i enabled it after enabling the port 8080 the ssh 22 port restricted to connect and it shows error in security group how to solve the problem? i need the remote of my server i checked security groups, ACL under vpc everything is good.i tried sg with all traffic,also with custom IP

1 Answer
0

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.

profile pictureAWS
SUPPORT ENGINEER
answered a year 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

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions