当通过HTTP访问时,覆盖SSH消息

如果您使用SSH端口(22)通过HTTP访问我的服务器,则会看到如下消息:

SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1

可能会显示不同的消息?

Debian / Ubuntu版本识别是Debian-ism ,不存在于标准的OpenSSH中。

您可以通过在/etc/ssh/sshd_config设置DebianBanner no来禁用它。

最终结果将是:

 SSH-2.0-OpenSSH_5.9p1 

您不应该禁用它,因为它需要协商SSH协议连接 。

/ etc / ssh / sshd_config中有一个Banner选项: The contents of the specified file are sent to the remote user before authentication is allowed. If the argument is “none” then no banner is displayed. This option is only available for protocol version 2. By default, no banner is displayed. The contents of the specified file are sent to the remote user before authentication is allowed. If the argument is “none” then no banner is displayed. This option is only available for protocol version 2. By default, no banner is displayed. 这样你不能删除版本string,但是使用它来提供法律信息是非常方便的。