ssh exchange identification: Connection closed by remote host

Jmnote (토론 | 기여)님의 2016년 5월 24일 (화) 15:10 판 (→‎같이 보기)

SSH 접속 불가
ssh_exchange_identification: Connection closed by remote host
외부 호스트에 의해 접속이 종료되었습니다.

1 문제 상황

아래와 같은 메시지가 나오면서 SSH 접속이 되지 않는다.

[root@localhost ~]# ssh example.com
ssh_exchange_identification: Connection closed by remote host
[root@localhost ~]# ssh 111.222.33.44
ssh_exchange_identification: Connection closed by remote host
→ 서버측에서 22포트를 LISTEN중이지만, 접속을 거부함

2 hosts.deny

평소 접속하는 PC에서 접속하니 잘 된다...

  • SSH 보안 강화 때문이었다.
[root@zetawiki ~]# cat /etc/hosts.deny | grep -v ^#
sshd: ALL
[root@zetawiki ~]# cat /etc/hosts.allow | grep -v ^#
sshd: 135.79.246.80, 123.456.
→ 모든 IP에서의 ssh 접속을 제한. (단, 지정한 IP대역[1]은 제외)
  • hosts.allow 에 IP를 추가해주니 sshd 재시작 없이 바로 접속된다.

3 같이 보기

4 주석

  1. 135.79.246.80과 123.456.x.x
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}