본문 바로가기

카테고리 없음

ssh_exchange_identification: read: Connection reset by peer 해결

다시 결론만 추가 하면
hosts.allow 또는 hosts.deny
TCP WAPPER 설정 정책에서 sshd가 막혀서 나오는 에러일 확률이 대부분임

 

ex) deny 에서 ssh를 all 차단 후  allow 에서 아이피가 허용이 안되어 있거나 등

 

 

SSH 로그인시 아래와 같은 에러 메세지 출력 후 접속 실패

~ $ ssh test@1xx.xxx.xx.45 -p 54321
ssh_exchange_identification: read: Connection reset by peer

결론만 말 하면

/etc/hosts.deny 파일내용에 내 ip 주소가 추가 되어 있어서 였다.

ALL: clinet ip 주소
ALL: 111.111.111.111 

내가 접속 하려는 pc의 공인 ip를 제거 후 접속이 다시 잘 되었다.

물론 이 부분 말고도 여러 이유가 있는거 같지만 난 이렇게 해결함.

 

###############################################

################# portsentry #################

###############################################

 

이 서버 같은 경우는 portsentry 라는 데몬을 사용 하였는데 처음에는 접속만 잘 되었는데 어느 순간 부터 접속이 안됨.

문제를 해결 후

conf 파일을 까보니 아래와 같은 설정 값들이 들어 있었음.

IGNORE_FILE="/usr/local/psionic/portsentry/portsentry.ignore"
HISTORY_FILE="/usr/local/psionic/portsentry/portsentry.history"
BLOCKED_FILE="/usr/local/psionic/portsentry/portsentry.blocke

KILL_HOSTS_DENY="ALL: $TARGET$"

방화벽 관련 데몬 같은데 정해진 임계치값을 넘어가면 자동으로 hosts.deny 에 등록 되는거 같음