こんにちは。
今回はFedora 41やRHEL9系(RockyLinuxなど)のLinuxからIX2215にSSH接続しようとしたら、エラーが出て接続できなかったので、改善法を備忘録として残しておきます。
エラー内容1
```
$ ssh user@192.168.200.200
Unable to negotiate with 192.168.200.200 port 22: no matching host key type found. Their offer: ssh-rsa
```
のようなエラーが出ます。
解決方法としては
~/.ssh/config に
```
Host 192.168.200.200
HostKeyAlgorithms +ssh-rsa
```
のように指定します。
エラー内容2
上記内容を設定すると、次は以下のようなエラーになります。
```
$ ssh user@192.168.200.200
ssh_dispatch_run_fatal: Connection to 192.168.200.200 port 22: error in libcrypto
```
解決方法としては、crypto-policiesをDEFAULT:SHA1にすると疎通するようになります。
```
$ sudo update-crypto-policies --set DEFAULT:SHA1
Setting system policy to DEFAULT:SHA1
Note: System-wide crypto policies are applied on application start-up.
It is recommended to restart the system for the change of policies
to fully take place.
```
```
$ ssh 192.168.200.200
user@192.168.200.200's password:
NEC Portable Internetwork Core Operating System Software
Copyright Notices:
Copyright (c) NEC Corporation 2001-2024. All rights reserved.
Copyright (c) 1985-1998 OpenROUTE Networks, Inc.
Copyright (c) 1984-1987, 1989 J. Noel Chiappa.
hoge-rt01# exit
```
ただし、脆弱な設定になるため、使用後は戻すようにしましょう。
```
$ sudo update-crypto-policies --set DEFAULT
Setting system policy to DEFAULT
Note: System-wide crypto policies are applied on application start-up.
It is recommended to restart the system for the change of policies
to fully take place.
```
その他
Macなどは現状以下コマンド(上記のエラー内容1)のみで行けるようです。
```
ssh -o HostKeyAlgorithms=+ssh-rsa user@192.168.200.200
```
コメント