Suppressing Login Messages
I do a lot of remote remote maintenance via ssh on my machines and one thing that I’ve long wondered about is the message outputted when you login. You know, the system information output plus the notice concerning the warranty, etc. Here is the output I’m referring to when connecting to my Sun Sparc Ultra 10 server via ssh:
Linux sparc 2.6.15-51-sparc64 #1 Tue Oct 23 21:46:00 UTC 2007 sparc64 GNU/Linux
The programs included with the Ubuntu system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.
Last login: Sun Dec 9 12:50:43 2007 from 192.168.0.6
Now, that information is not ultra annoying by any means, but sometimes after repeated connections I just really don’t want to see it. So, I finally found way that the information above can be suppressed. All you need to do is create an empty file in your home folder and those login messages will be suppressed.
Run that command, which just “touches” a file into creation with no contents. If the login system finds that file it’ll suppress the login message above. Note: if you want login messages suppressed on remote machines you need to create this file on the remote end.
Enabling Login Messages
The login message above actually comes from a file on the machine at /etc/motd. If you’d like to change the message on your machine you can simply edit that file.
sudo vim /etc/motd
If you’d like to enable a different login message, which can often be used to pass messages to anyone logging into the system, this might be a good place to do it.