0

Connection refused" errors when trying to connect to my EC2 instance with SSH.

I am receiving Connection refused errors when trying to connect to my EC2 instance with SSH. How do I resolve this?

michael
asked Oct 31, 2021
1 Answer
0

Use AWS Systems Manager Session Manager

  1. Open the AWS Systems Manager console.
  2. Start a session.
  3. To disable firewalls and restart the SSH service, run the following commands.
    sudo iptables -F
    sudo service sshd restart

  4. Verify that the SSH tcp port (22) is in a listening state.

    sudo netstat -tnlp | grep :22
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      849/sshd
    tcp6       0      0 :::22                   :::*                    LISTEN      849/sshd
    
  5. Terminate the session.
  6. Connect to the instance using SSH.
View More
linuxhelp
answered Oct 31, 2021
Your Answer
||||
 
100:0

Related Forums in Connection refused" errors when trying to connect to my EC2 instance with SSH.

Related Forums in Connection refused" errors when trying to connect to my EC2 instance with SSH.