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

  • December 20, 2006
  • Avatar for peter
    Peter
    Upfold

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

Home » Articles »