Skip to content

port 22: Connection refused 포트22 연결 거절 관련 문의

0

WinScp Can't see the file list after installation

sudo nano /etc/ssh/sshd_config 를 실행

Subsystem sftp /usr/libexec/openssh/sftp-server 아래줄에 Subsystem sftp /usr/lib/openssh/sftp-server

추가하고 저장

sudo systemctl restart sshd error

이후로 서버에 접속 안됨 (22번 포트) ssh: connect to host 11.11.11.11 port 22: Connection refused

asked a year ago196 views

2 Answers
1

Hello.

Based on the message content, sshd failed to start, causing SSH connection failure.
Although it depends on the EC2's OS, connection is possible through Systems Manager Session Manager, so please connect to EC2 and reconfigure the sshd settings.
Please check the content of the following document and configure the settings.
https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started.html

EXPERT

answered a year ago

0

Do you have port 22 open in the security group of the EC2, if not you will need to allow in the security group. Also, it's possible you have duplicate Subsystem sftp definition causing the issue. To confirm,

  • login to the EC2 via SSM
  • open /etc/ssh/sshd_config in nano or vi
  • check if you have incorrect or duplicate reference to subsystem
  • modify the config and restart - sudo systemctl restart sshd
  • Recheck connectivity
EXPERT

answered a year ago

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.