SSH tip - display a message to everyone when they log in

So, you've set up SSH as per my quick tutorial, but here's a nice, easy and quick tip to display a message to all users when they login.

You can put anything really - remind them to follow your guidelines, warn them that they shouldn't do anything nasty, some nice ASCII art perhaps - or just display a welcome message.

You need to place your message in the file /etc/motd (that's message of the day, not Match of the Day). You'll need root privileges (aka super-administrator) to edit this file, so launch a terminal and do:

$ su -
[[enter your root password]]
# vim /etc/motd

I've used the vim editor here, but substitute in your favourite text editor (a couple of graphical ones are gedit for Gnome and kwrite for KDE). Ubuntu users - skip the su - bit and prefix the last command with the word sudo.

Just place your message in that file, save it and then all your remote logins (and local text-based ones too) will get shown that message.

Easy, quick and nice.

Avatar for peter Peter Upfold - http://peter.upfold.org.uk/

Peter Upfold is a technology enthusiast from the UK. Peter’s interest in Linux stems back to 2003, when curiosity got the better of him and he began using SUSE 9.0. Now he runs Linux Mint 9 on the desktop, runs a CentOS-based web server from home for his personal website and dabbles in all sorts of technology things across the Windows, Mac and open source worlds.

Home » Articles »

Discussion: SSH tip - display a message to everyone when they log in

  1. marc (guest)

    # Posted on 02 February 2007 at 08:27 AM

    just what i needed, quick, to the point. thx!



Home » Articles » SSH tip - display a message to everyone when they log in