대학에서는 일반적으로 컴퓨터 과학 서버에 SSH로 접속합니다. 그러나 오늘 나는 다음과 같은 오류가 계속 발생합니다 ssh_exchange_identification: Connection closed by remote host
. -v
플래그로 SSH를 사용하면 다음을 얻을 수 있습니다.
OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to ... [...] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "~/.ssh/id_rsa" as a RSA1 public key
debug1: identity file ~/.ssh/id_rsa type 1
debug1: identity file ~/.ssh/id_rsa-cert type -1
debug1: identity file ~/.ssh/id_dsa type -1
debug1: identity file ~/.ssh/id_dsa-cert type -1
ssh_exchange_identification: Connection closed by remote host
호스트 파일을 편집하려고 시도했지만 도움이되지 않습니다. 어떤 제안?
답변
제공 할 키가 너무 많을 때 발생할 수 있습니다. 이 연결에 사용 된 항목과 전역 에 추가 IdentityFile ~/.ssh/id_rsa_keyname
하여 쉽게 해결할 수 있습니다 . 이것은 다음과 같이 보일 수 있습니다 : ~/.ssh/config
IdentitiesOnly yes
~/.ssh/config
Host foo
hostname server.example.com
User myUserName
IdentityFile ~/.ssh/id_rsa_keyname
Host *
IdentitiesOnly yes
답변
나는이 똑같은 문제에 부딪쳤다. 내 시스템 로그가 반영되었습니다.
/var/empty must be owned by root and not group or world-writable
Disk Utility > Macintosh HD > Repair Disk Permissions
권한 을 재설정하고 /var/empty
문제를 해결했습니다.
답변
답변
이 오류는 여러 가지 이유로 발생할 수 있습니다. 필자의 경우 High Sierra (macOS)로 업그레이드 한 후였습니다.
Host *
UseKeychain yes
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
테스트:
ssh -vvv git@github.com
추가 읽기 : https://github.com/jirsbek/SSH-keys-in-macOS-Sierra-keychain