How to display SSH banner at login, but only for password authentication

Posted by banjer on Server Fault See other posts from Server Fault or by banjer
Published on 2010-06-09T13:19:13Z Indexed on 2010/06/09 13:23 UTC
Read the original article Hit count: 254

Filed under:
|
|
|

I have a warning message that is displayed to a user after they enter their username to log in to our Linux servers. I only want to display this message for password authentications, and not when keys are used. It should only show to a user who is logging into a host, and not when they are sshing from one host to another (our hosts all have keys set up so we can ssh from one to another without entering passwords).

Currently, I have a line for Banner in the /etc/ssh/sshd_config file which points to a text file containing the warning message. Banner doesn't appear to have any further config options, so I'm wondering if there is a way to do this with pam or some other mechanism? Thanks.

© Server Fault or respective owner

Related posts about linux

Related posts about ssh