SSH login text can clutter automation logs, screen recordings, and support transcripts before the shell prompt appears. Suppressing the server-side banner, MOTD (message of the day), and last-login line keeps interactive SSH sessions focused on the command prompt while leaving authentication and logging behavior unchanged.
The OpenSSH server controls the pre-authentication banner with the Banner directive. Post-login text is split across PrintMotd, PrintLastLog, and, on Ubuntu or Debian systems that use PAM, pam_motd.so entries in /etc/pam.d/sshd.
Suppress only messages that are operational noise. Keep legal notices, access warnings, and maintenance notices enabled when policy requires them, and keep an existing SSH session or console path open until a new login reaches the prompt without the old text.
Related: How to reduce SSH client output
Related: How to increase SSH client verbosity
Keep the current session open until a separate test login succeeds after the reload.
$ sudo cp /etc/pam.d/sshd /etc/pam.d/sshd.bak
Ubuntu and Debian commonly print MOTD text from PAM even when OpenSSH reports PrintMotd no.
$ sudoedit /etc/ssh/sshd_config.d/00-suppress-login-messages.conf
Use /etc/ssh/sshd_config instead if the server configuration does not include /etc/ssh/sshd_config.d/*.conf.
Banner none PrintMotd no PrintLastLog no
Banner none removes the pre-authentication notice. PrintMotd no and PrintLastLog no suppress MOTD and last-login output handled directly by sshd.
$ sudoedit /etc/pam.d/sshd
Skip this edit on hosts that do not use PAM for SSH sessions or do not contain pam_motd.so entries.
#session optional pam_motd.so motd=/run/motd.dynamic #session optional pam_motd.so noupdate
Commenting these lines suppresses SSH MOTD output for all users who pass through /etc/pam.d/sshd. Do not remove policy-required notices.
$ sudo sshd -t
No output means the active sshd configuration parsed successfully.
Related: How to test SSH server configuration
$ sudo systemctl reload ssh
Use sudo systemctl reload sshd on systems where the unit is named sshd. If reload is unsupported, restart only after sshd -t succeeds.
Related: How to manage the SSH server service with systemctl
$ sudo sshd -T port 22 addressfamily any listenaddress [::]:22 listenaddress 0.0.0.0:22 usepam yes ##### snipped ##### printmotd no printlastlog no ##### snipped ##### banner none ##### snipped #####
Related: How to view SSH server configuration
$ ssh user@host.example.net user@host:~$
The prompt should appear without the previous banner, MOTD, or last-login text. If other text still appears, check shell startup files such as /etc/profile, files under /etc/profile.d, or the user's shell profile.