현상
원격 서버에 ssh 접속을 시도했더니, 아래와 같은 오류가 발생하면서 접속에 실패했다.
key exchange method 를 찾을 수 없다고 하면서, 3개의 선택지를 제안해줬다.
- diffie-hellman-group-exchange-sha1
- diffie-hellman-group14-sha1
- diffie-hellman-group1-sha1
원인
ssh 버전으로 인해 key exchange method 를 직접 지정해줘야한다.
https://www.openssh.com/legacy.html
OpenSSH: Legacy Options
OpenSSH Legacy Options OpenSSH implements all of the cryptographic algorithms needed for compatibility with standards-compliant SSH implementations, but since some of the older algorithms have been found to be weak, not all of them are enabled by default.
www.openssh.com
해결
ssh 명령에 -oKexAlgorithms= 옵션을 추가해 처음 오류 문구에 있던 제안된 암호화 방식 중 1개를 넣어준다.
ssh -oKexAlgorithms=diffie-hellman-group-exchange-sha1 [id]@[host] -p 22
앞에서 제안된 3개의 선택지 중 어떤 것을 넣어도 접속이 가능하다.
댓글