ความปลอดภัยและการเข้าถึง

How to fix "no matching host key type found"

เมื่อเรา remote ไปที่เครื่อง linux server ด้วย ssh แต่พบว่าไม่สามารถ remote เข้าไปได้และพบ error ตามด้านล่าง

Unable to negotiate with 192.168.1.168 port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss

error นี้เกิดจาก client ใช้ ssh version ใหม่ซึ่งได้ disable ssh-rsa และ ssh-dss สามารถดูข้อมูลเพิ่มเติม https://www.openssh.com/legacy.html วิธีการแก้ไข

  1. เพิ่ม option ที่คำสั่ง สำหรับ ssh-dss
ssh -oHostKeyAlgorithms=+ssh-dss [email protected]

สำหรับ ssh-rsa

ssh -oHostKeyAlgorithms=+ssh-rsa [email protected]
  1. แก้ไขที่ config ~/.ssh/config สำหรับ ssh-dss
Host 192.168.1.168
  HostName 192.168.1.168
  HostKeyAlgorithms=+ssh-dss

สำหรับ ssh-rsa

Host 192.168.1.168
  HostName 192.168.1.168
  HostKeyAlgorithms=+ssh-rsa
EOF.← กลับไปอ่านบทความอื่น