내가 겪고 있는 문제는 서버를 최신 버전으로 업그레이드한 후 내 서버가 Cisco 장치에 SSH를 통해 연결할 수 없다는 것입니다.
ssh -vvv,
잘 모르겠는 부분을 두 부분으로 만들었습니다 . 세부사항은 다음과 같습니다:
비밀번호 ctos와 비밀번호 stoc의 의미를 알고 싶습니다.
비밀번호:[email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
암호화폐 주식:[email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
또한 로그 끝에 다음 메시지가 표시됩니다. 10.44.39.202 포트 22와 협상할 수 없습니다. 일치하는 키 교환 방법을 찾을 수 없습니다. 그들의 인용문:diffie-hellman-group1-sha1
diffie-hellman-group1-sha1
호스트 키 알고리즘에 추가할 수 있나요 ?
다음은 디버그 로그입니다.
-bash-4.0# ssh -vvv 10.44.39.202 OpenSSH_7.7p1, OpenSSL 1.0.2j-fips 26 Sep 2016
debug1: Reading configuration data /usr/etc/ssh_config
debug2: resolve_canonicalize: hostname 10.44.39.202 is address
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 10.44.39.202 [10.44.39.202] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_xmss type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.7
debug1: Remote protocol version 2.0, remote software version Cisco-1.25
debug1: match: Cisco-1.25 pat Cisco-1.* compat 0x60000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 10.44.39.202:22 as 'root'
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: [email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected],zlib
debug2: compression stoc: none,[email protected],zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: diffie-hellman-group1-sha1
debug2: host key algorithms: ssh-rsa
debug2: ciphers ctos: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc
debug2: ciphers stoc: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc
debug2: MACs ctos: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96
debug2: MACs stoc: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96
debug2: compression ctos: none
debug2: compression stoc: none
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: (no match)
Unable to negotiate with 10.44.39.202 port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
답변1
기본적으로 업그레이드된 OpenSSH에는 더 이상 키 교환 알고리즘으로 diffie-hellman-group1-sha1이 포함되지 않지만 이는 Cisco 장치에서 제공하는 유일한 키 교환 알고리즘입니다.
가장 빠른 해결 방법은 SSH 클라이언트에 diffie-hellman-group1-sha1을 사용하여 장치와 통신할 수 있음을 알리는 것입니다. 다음과 같이 ~/.ssh/config에 섹션을 추가합니다.
Host 10.44.39.202
KexAlgorithms +diffie-hellman-group1-sha1
인용하다:
클라이언트와 서버가 상호 매개변수 집합에 동의할 수 없으면 연결이 실패합니다. OpenSSH(7.0 이상)에서는 다음과 같은 오류 메시지가 생성됩니다.
Unable to negotiate with legacyhost: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1