Quick Tip: Turn off the login banner in Linux or Unix .hushlogin file

Did you know? You can turn off the banner in Linux or Unix using a particular file. When you log in using ssh or other methods, you will find tons of information on the screen. Here is how my FreeBSD home server login looks:

FreeBSD login bannerFreeBSD login banner

Default motd with my hardware and other info

The first one is /etc/motd, and the second is the output of neofetch called from ~/.profile file. And my Ubuntu Linux box showing stuff too when I login using the ssh command:
cat command:
cat /etc/motd
Individual users are allowed to suppress this file’s display by creating a file called .hushlogin in their home directories. The concept of /etc/motd was created as it requires much less disk space than mail to all users.

Turning off the login banner in Linux or Unix using .hushlogin file

touch ~/.hushlogin
touch $HOME/.hushlogin


Here is a quick video:

cat command:
more /etc/motd
# freebsd specific #
cat /etc/motd.template
cat /etc/motd*
# Ubuntu #
ls -l /etc/update-motd.d

Please note that Ubuntu Linux uses update-motd file, which is a dynamic MOTD generation tool. See “How to disable ssh motd welcome message on Ubuntu Linux” for more info. Check out motd and login man page by typing the following man command:
man motd
man login

Posted by Contributor