SSH login banners and MOTD lines present welcome text, usage policies, or system information before the shell prompt appears. On busy bastion hosts, automation targets, or shared servers, trimming or tailoring these messages keeps logins concise and avoids unnecessary noise in terminal logs and screenshots.
The OpenSSH server sshd controls these messages through the main configuration file /etc/ssh/sshd_config. The Banner directive chooses a custom text file or disables banners entirely, while PrintMotd controls the static MOTD. On Ubuntu and related systems, additional dynamic MOTD fragments are assembled from executable scripts in /etc/update-motd.d, which run at each login to generate rotating system summaries.
Changing these settings affects every SSH login on the host, so configuration updates need to respect organizational policy and any legal requirements for login notices. Disabling MOTD scripts or misconfiguring /etc/ssh/sshd_config can hide important status messages or prevent sshd from starting, so keeping a recovery path such as console or out-of-band access available before applying changes is important.
Related: How to reduce SSH client output
Related: How to increase SSH client verbosity
Related: How to configure the log level for an SSH server
$ whoami user
$ sudo vi /etc/ssh/sshd_config
Any text editor such as vi, nano, or vim is suitable as long as it saves plain text.
# disable banner Banner none # use a custom banner file Banner /etc/issue.net
Add Banner if it is missing, remove # at the start of the line to un-comment it, and ensure the referenced file exists and is readable by the sshd process.
Place shared banner text in a root-owned file such as /etc/issue.net with read-only permissions to prevent accidental modification.
# disable the static MOTD PrintMotd no # keep the static MOTD enabled PrintMotd yes
Add or un-comment PrintMotd in /etc/ssh/sshd_config so the configured value clearly reflects the intended behavior.
When PrintMotd is set to yes, edit /etc/motd to control the static message content presented after login.
$ sudo chmod -x /etc/update-motd.d/*
Remove execute permission only from specific scripts instead of all files to keep useful summaries while dropping unneeded sections.
Disabling all scripts in /etc/update-motd.d suppresses dynamic health warnings or maintenance notices that some environments rely on for operational awareness.
$ sudo sshd -t
No output from sshd -t indicates that the configuration syntax is valid.
Restarting sshd with invalid configuration can terminate current sessions and prevent new SSH logins until the error is corrected locally.
Related: How to test SSH server configuration
$ sudo systemctl restart ssh
$ ssh user@host.example.net hostname host
After disabling the banner and MOTD scripts, the login sequence omits previous banner text and dynamic MOTD lines, leaving only the command output or shell prompt.