Whenever you log in to a remote SSH server, you'll be greeted with some messages before getting the shell prompt. The messages could be directly from SSH or a generic terminal login message.

The messages are called banner or MOTD (Message Of The Day), and while it could display valuable messages, some would consider it a nuisance and want to go straight to the command prompt.

You can disable or edit these banners or MOTD messages when you log in to an SSH server by configuring SSHd 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

    Add the line if it doesn't already exist and remove # at the beginning of the line if it exists.

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

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

    Add the line if it doesn't already exist and remove # at the beginning of the line if it exists.

    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 scripts or add your own to create a custom message.

Discuss the article:

Comment anonymously. Login not required.