2025年5月22日 星期四

New SSH client to old SSH server

從新版 SSH 8.x 連到舊版 6.x SSH server
若出現
Unable to negotiate with x.x.x.x port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss
因為較新版已禁用一些舊的加密協定導致無法連

可設定 LEGACY 使可以連
update-crypto-policies --set LEGACY

若要改回來是
update-crypto-policies --set DEFAULT

OpenSSH 8.8 之後,ssh-rsa (RSA 搭配 SHA-1) 被預設關閉,用 LEGACY 也沒用,
需要在 ~/.ssh/config 或系統的 /etc/ssh/ssh_config 設定

Host x.x.x.x
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa

要另外產生一把 RSA Key 來連舊系統
指令 ssh-keygen -t rsa
(較新版的 OpenSSH client 預設的 Key Type 是 ed25519)

沒有留言:

0xC2A0 Non-breaking space

0xC2A0 是不換行空格(Non-breaking space, NBSP) 在 UTF-8 編碼下的十六進制表示形式。 字元作用:它的外觀與一般的空格(ASCII 0x20)完全相同,但其功能是告訴瀏覽器或排版軟體「不要在此處斷行」。 這個字元在維運是個雷 這兩行中間的空白看...