The MOTD is generated by scripts in
/etc/update-motd.d
. You can change those to affect the generated MOTD.To stop displaying the MOTD on every login (“Welcome to Ubuntu[…]”), edit
/etc/pam.d/login
like so:
--- /etc/pam.d/login.before
+++ /etc/pam.d/login
@@ -85 +85 @@
-session optional pam_motd.so
+# session optional pam_motd.so
A similar change is required for all PAM services showing the MOTD, often including sshd
.
- To disable this mechanism, instead of commenting the line, add the
noupdate
option like so:
--- /etc/pam.d/login.before
+++ /etc/pam.d/login
@@ -85 +85 @@
-session optional pam_motd.so
+session optional pam_motd.so noupdate
Again, the same change is required in all services using pam_motd.so
. You also need to disable the execution on boot with this change:
--- /etc/init/mounted-run.conf.before
+++ /etc/init/mounted-run.conf
@@ -22 +22 @@
- [ -d "/etc/update-motd.d" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd &
+ # [ -d "/etc/update-motd.d" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd &