解决跳板机问题

公司的IDC,需要通过堡垒机登录,有两种方式

  1. 使用web shell,这个非常简单,在公司的opencloud页面上就可以使用,而且省去了输入ssh用户名和密码。
  2. 使用ssh终端,总是失败,请教了运维同事,他也不清楚,还好有chatgpt的神助攻,画了1小时解决了。

失败信息

on my mac :# ssh username@jump.server.com
Unable to negotiate with X.X.X.X port 22: no matching host key type found. Their offer: ssh-rsa

chat gpt给出的建议

It appears that you’re trying to SSH from your Mac to the server at jump.server.com, and you’re encountering the "no matching host key type found" error with an offer of "ssh-rsa." This error typically occurs when the SSH client and server cannot agree on a suitable host key algorithm.

To resolve this issue, you can use the -o option to specify the host key algorithm explicitly in your SSH command. For example, you can use the -o option to force the use of the "ssh-rsa" host key algorithm like this:

ssh -o HostKeyAlgorithms=+ssh-rsa username@jump.server.com

This command tells the SSH client to use the "ssh-rsa" host key algorithm when connecting to the server.

However, it’s worth noting that "ssh-rsa" is considered less secure than modern alternatives like "ssh-ed25519" or "ecdsa-sha2-nistp256." If possible, you should encourage the server administrator to update the SSH server’s host key algorithm configuration to use a more secure option.

Additionally, ensure that your SSH client is up to date, as older versions may not support some of the newer host key algorithms.

Leave a Reply

Your email address will not be published. Required fields are marked *