Whenever you log in to a remote server via SSH you'll be greeted with some messages prior to your shell prompt. It could be SSH-specific messages or generic terminal login messages.

These banner or MOTD (Message Of The Day) messages could be used to display some useful messages though some would prefer to just go straight to the command prompt.

You can disable or edit these banner / MOTD messages when logging in to an SSH server by configuring some options on the server.

Steps to suppress or customize login welcome messages for SSH:

  1. Launch terminal.
  2. Open SSHd configuration file using your preferred text editor.
    $ sudo vi /etc/ssh/sshd_config
    [sudo] password for user:
  3. Look for Banner directive and set the value to none.
    Banner none

    Make sure the line is not commented by removing # at the start if present.

    Set the value to a file and add your own text to create custom banner message.

  4. Look for PrintMotd directive and set the value to no.
    PrintMotd no

    Make sure the line is not commented by removing # at the start if present.

    Set the value to yes and change the /etc/motd file for custom Message Of The Day.

  5. Disable execution of motd scripts
    $ sudo chmod -x /etc/update-motd.d/*

    Selectively disable existing script or add your own to create custom message.

Support us on Patreon if this guide has helped you. Thanks!!!

Discuss the article:

Comment anonymously. Login not required.

Share!