如何在“登录为:”提示之前显示 SSH 横幅?

Mik*_*e B 3 centos openssh sshd

CentOS 5.x

当我Banner /path/to/banner在 sshd 配置文件中启用该参数时,横幅会在login as:提示后显示。

例如:

login as: foo
***********************************************************
Test Example SSH Banner Text
This is a test
Example 12345
***********************************************************
foo@1.2.3.4's password:
Run Code Online (Sandbox Code Playgroud)

诚然,对于使用在连接之前已指定的用户名进行连接的 ssh 连接来说,这不是问题。但是对于没有预先选择用户名的 ssh 连接,用户在连接时会看到:

login as:
Run Code Online (Sandbox Code Playgroud)

有没有办法让横幅在login as:提示之前显示?

Flu*_*lup 5

这是由您的客户端而不是服务器引起的。该login as:提示是腻子本身,并输入用户名之前,它不会显示的旗帜。如果您使用共享密钥,那么即使密钥继续被拒绝,横幅也会在密钥交换时显示。