[Linux/SSH] no matching key exchange method found.

개요

시스코 스위치 장비에 SSH 설정 후, 리눅스 서버에서 원격 접속 하니 아래와 같은 에러가 발생하였음.

no matching key exchange method found. their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

원인

SSH6 까지는 제공해주었던 key exchange method가 SSH7부터 보안상 이유로 별도 옵션을 추가해줘야 함.


해결 방법

1. /etc/ssh/ssh_config 파일에 key exchange method 옵션을 추가.

KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1

2. SSH 접속 시 key exchange method 옵션을 지정하여 접속

ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa <사용자>@xx.xx.xx.xx

관련 글