'SSH'에 해당되는 글 1건

  1. 2021.12.04 SecureCRT를 사용한 ubuntu 20.04 ssh 접속 오류 (key exchange) 2
2021. 12. 4. 20:07

SecureCRT를 사용한 ubuntu 20.04 ssh 접속 오류 (key exchange)

세상 참 빠르게 바뀌고 있다.

Ubuntu 20.04를 설치하고, Local 에서만 작업하다, 어느날 ssh를 접속해야 할 필요가 생겼다.

Putty로는 잘 되는데, SecureCRT v7.1.3을 사용하여 접속하려니,

Key exchange failed.
No compatible key exchange method. The server supports these methods: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256

이런 오류가 발생하였다.

SSH7 로 바뀌면서 SSH6의 key 교환 방식을 disable 시켰다고 한다. (보안상의 이유)

우선은 간단하게 다시 enable 시키려면,

# vi /etc/ssh/sshd_config

맨 아래에 두줄을 추가한 후 

# for SSH6 key exchange
KexAlgorithms +diffie-hellman-group1-sha1
Ciphers +aes128-cbc

sshd 서비스를 재 가동

# systemctl restart sshd

이제 다시 ssh 접속이 가능하다.

나는 local 에서만 사용할 것이라서.... 보안상 이유를 무시하고 사용한다.

참고하시길.

첨언:

https://www.howtoforge.com/community/threads/enable-diffie-hellman-group1-sha1-on-jessie.70764/#post-337033

를 보면, 아예 이전의 Key 알고리즘이 없어서 그런 것이니, 등록하고, Key를 만들면 문제가 해결된다고 한다.

# vi /etc/ssh/sshd_config

아래 두 줄을 추가하고,

KexAlgorithms diffie-hellman-group1-sha1,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
Ciphers 3des-cbc,blowfish-cbc,aes128-cbc,aes128-ctr,aes256-ctr

저장한 후, key를 만들고, sshd 서비스를 재시작하라고 한다. 누구 해보신 분 추가 설명 요망.

# ssh-keygen -A

# systemctl restart sshd

.끝.