This question already has an answer here:

CentOS 5.x

When I enable the Banner /path/to/banner parameter in my sshd config file, the banner displays AFTER the login as: prompt.

For example:

login as: foo
Test Example SSH Banner Text
This is a test
Example 12345
foo@'s password:

Admittedly this isn't an issue for ssh connections that connect with a username already specified prior to connecting. But for ssh connections that don't have a user name preselected, users see this upon connecting:

login as:

Is there any way to get the banner to display BEFORE the login as: prompt?

marked as duplicate by slm, jasonwryan, Renan, Michael Mrozek Mar 19 '14 at 16:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • What client are you using to connect? – Flup Mar 19 '14 at 15:54
  • @flup PuTTY on a Windows workstation. – Mike B Mar 19 '14 at 15:56
  • 1
    Don't let the title of that dup fool you, my answer explains that this isn't possible. – slm Mar 19 '14 at 16:03
  • @slm that probably explains why I didn't think there were any matches when searching for similar questions. ;-) – Mike B Mar 19 '14 at 16:04
  • @MikeB - yes that Q was easier for me to find but probably not anyone else 8-) – slm Mar 19 '14 at 22:08

This is caused by your client rather than the server. The login as: prompt is PuTTY's own, and it won't display the banner before a username is entered. If you're using shared keys, then the banner will be displayed at key exchange time, even if the key goes on to be rejected.

  • I don't know about you but my PuTTY sessions actually do display the contents of /etc/issue. It is still up to the client whether they want to actually display that, though. – Bratchley Mar 19 '14 at 16:48
  • 1
    It does display the banner, but only after the username is entered; I think the OP wanted the banner to appear before the prompt. – Flup Mar 20 '14 at 10:25
  • You're talking about /etc/motd there, I'm referring to /etc/issue which is the pre-login banner intended to tell people the system is being monitored, etc. – Bratchley Mar 20 '14 at 13:12
  • Nono, we're talking about the same thing -- my PuTTY displays /etc/issue after entering the usernanme, but before entering the password. – Flup Mar 20 '14 at 13:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.