Unable to negotiate with 192.168.1.1 port 22: no matching host key type found. Their offer: ssh-dss
Unable to negotiate with 192.168.1.2 port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
- 해결책 1
시스템 전체에 적용되는 해결책이다.
Vi와 같은 텍스트 에디터를 이용해 /etc/ssh 디렉토리에 있는 ssh_config 파일을 연다.
sudo vi /etc/ssh/ssh_config
아래와 같이 라인을 찾아 맨 앞에 있는 # (Hash/Pound)을 제거한다.
# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
그리고 맨 아래에 아래와 같은 라인을 추가한다.
HostkeyAlgorithms ssh-dss,ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha1
전체적으로 아래와 같이 될 것이다.
# Port 22
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
# VisualHostKey no
# ProxyCommand ssh -q -W %h:%p gateway.example.com
# RekeyLimit 1G 1h
Host *
SendEnv LANG LC_*
HostkeyAlgorithms ssh-dss,ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha1
저장하고 나가면 바로 적용이 된다. 리부팅이 필요없다.
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
# VisualHostKey no
# ProxyCommand ssh -q -W %h:%p gateway.example.com
# RekeyLimit 1G 1h
Host *
SendEnv LANG LC_*
HostkeyAlgorithms ssh-dss,ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha1
저장하고 나가면 바로 적용이 된다. 리부팅이 필요없다.
/etc/ssh/sshd_config
하단에 아래 항목도 적어줘야 할 수 있음
HostkeyAlgorithms ssh-dss,ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha1
KexAlgorithms +diffie-hellman-group1-sha1