要求在OTP和密码请求之前显示SSH横幅

我们对一些服务器使用双因素authentication,即OTP(一次性密码)令牌encryption码。

我想在向用户提供一些信息之前,要求他们的凭据。 使用单因素身份validation,可以很容易地使用通常的横幅来完成,例如像/ etc / ssh / sshd_banner这样的文件,并且在/ etc / ssh / sshd_config文件中

Banner /etc/ssh/sshd_banner

不幸的是,它似乎不适用于2FA。 横幅&configuration在位,但login过程如下所示:

 Using keyboard-interactive authentication. Your OTP: ****** Using keyboard-interactive authentication. Password: ********** 

这里来的横幅文本,为时已晚:

 Login on this host as <x-userid> & OTP, proceed to your hosts as <userid> Last login: Wed Mar 29 11:48:34 2017 from xxx.xxx.xxx.xxx x-xyz@host:~> 

你有没有尝试把旗帜放在/etc/issue.net ? 这应该显示在别的之前。