Edit SSH After Login Info i.e. MOTD on Deb GNU/Linux including Execution of Scripts. In Post PRISM Acknowledged Era, Functions Has Been Changed. For example, you can not add colors to SSH Pre login Screen. The linked article was for pre-login, before the interactive shell started, that was a gateway of Edward Snowden’s co-workers to sniff what scripts you kept on your server. on official Debian Wiki, it is written – “Debian has a peculiar way of handling /etc/motd”, that peculiar now changed a bit more and you can not do whatever you want unless you are compiling the GNU/Linux yourself. But, many of the functions are basic and can be edited.
Edit SSH After Login Info (MOTD) on Deb GNU/Linux
We are giving you the current directory and file structure after testing on Ubuntu 14.04 LTS. In case of Ubuntu, the directory /etc/update-motd.d
is present. In case of older Debian, you need to create :
1 | mkdir /etc/update-motd.d |
This is 100% correct way and written in official Debian Wiki. Because of NSA Spyware related security problems, we will not do anything beyond this /etc/update-motd.d
directory. If you cd to /etc/update-motd.d
and do a ls
:
---
1 | cd /etc/update-motd.d && ls |
you’ll see these stuffs on Ubuntu :
1 2 3 | 00-header 51-cloudguest 97-overlayroot 10-help-text 90-updates-available 98-fsck-at-reboot 50-landscape-sysinfo 91-release-upgrade 98-reboot-required |

Editing the Existing Files is The Easy Way
If you cat
each file, you’ll get the idea what they does, like :
1 | cat 00-header |
Debian and Ubuntu uses a batch of scripts in /etc/update-motd
that are executed by the pam_motd
module when users login and fetch information from the various scripts assembled in /var/run/motd
. /etc/motd
is symlinked to /var/run/motd
. You can modify the default files for adding shell scripts. Exactly it is that safe as nicely working. You can print text with easy command inside them like :
1 2 | echo " Example Text" echo " " |
On a fresh install, the MOTD is generated from three places:
- scripts in /etc/update-motd.d/
- compiled binaries controlled by /etc/pam.d/login
- and the /etc/legal file