40

Is there a way to suppress the banner output that's sent from sshd using the Banner option when using ssh clients like ssh or scp?

I've looked at the options and config file, but can't seem to find anything.

dirkt
  • 31,679
  • 3
  • 40
  • 73

1 Answers1

52

Use the -q (quiet) option to ssh and scp, to suppress the /etc/motd (and related) messages.

While Banner might seem to be related, it is not. Refer to sshd_config manual:

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. By default, no banner is displayed.

You could use PrintMotd (in sshd_config):

PrintMotd
Specifies whether sshd(8) should print /etc/motd when a user logs in interactively. (On some systems it is also printed by the shell, /etc/profile, or equivalent.) The default is yes.

but in scripting, I simply use the -q option (requiring less configuration of the server).

Archemar
  • 31,183
  • 18
  • 69
  • 104
Thomas Dickey
  • 75,040
  • 9
  • 171
  • 268
  • 2
    Thanks, `-q` also works to supress the Banner. – dirkt Oct 31 '16 at 09:03
  • 2
    "-q" on Solaris 5.10 did not suppress the banner, only the file transfer status. – access_granted Apr 27 '20 at 20:43
  • 1
    works for ssh, Thanks. I also try via gitbash did scp to Ubuntu 16.04.7 LTS (Xenial Xerus) "-q" suppress banner and file transfer status. Would be great if the file transfer status is kept. :/ – Yusufmm Feb 08 '21 at 02:30
  • 2
    Unfortunately, `-q` suppresses **everything**. Too bad there's only a "suppress banner". – RonJohn Nov 05 '21 at 23:46