Changing the welcome message in SSH
on Thursday, December 18th, 2008 at 1:57 pmIf your a linux user or maybe a simple linux server administrator with some servers at hand, the chances are that you use SSH to login there and manage them.
When a user logs in to SSH usually he sees a welcome message.
If you have an ubuntu machine like me then you will see the following message
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.
To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/
In order to change this message just type in the terminal

Update:
Note: On restart your changes to /etc/motd will be reverted, the reason is that /etc/motd is a symbolic link to /var/run/motd which is rebuilt by /etc/init.d/bootmisc.sh from a template, /etc/motd.tail, at each reboot. (thank you Adam Trickett).
lrwxrwxrwx 1 root root 13 2008-11-27 14:18 motd -> /var/run/motd
jo@jo-desktop:/etc$
This means that to make your changes permanent you can either:
1. change
then reboot
2. point the /etc/motd symlink to a different file such as /etc/motd.static and make your changes there. (Also thank you Adam Trickett).
Joe
10 Comments »
Thank you so much Jo, this makes us feel really at ~, i mean at home
One more tip, if anyone would like to have a cute design, just follow this link :
http://www.google.com/search?q=ascii+images
Cheers !!
and to get a prompt before you login (banner while logging in)…….
modifiy /etc/ssh/sshd_config
add or uncomment the line: Banner /etc/banner
Edit /etc/banner
restart ssh
et viola……you have a banner login screen for ssh
Your suggestion is a bit simplistic, you probably shouldn’t bother with the /etc/motd file, rather you need to tinker with /etc/motd.tail instead.
Have a quick read of the man pages for motd and motd.tail
From the Debian notes:
5.15 Message of the day
/etc/motd is now a symlink to /var/run/motd which is rebuilt by /etc/init.d/bootmisc.sh from a template, /etc/motd.tail, at each reboot. It means that changes made to /etc/motd will be lost. Changes made into /etc/motd.tail are not automatically applied to /etc/motd other than at reboot.
Also, the EDITMOTD variable at /etc/default/rcS no longer has any effect. If you wish to disable updating of the motd, or want to maintain your own content for the message of the day you just have to point the /etc/motd symlink to a different file such as /etc/motd.static and make your changes there.
@Adam:
Thank you Adam for your comment, actually you are right but i rarely restart my server
and what i wrote about above was just a simple suggestion.
Thank you again for your comment. I will update the article with your useful info.
Not to be picky, but motd displays for any login terminal, not just an SSH session. Xterm, telnet, etc. will all see the the message.
Just my little contrib.
Here’s my banner…
rock on man… only if your an authorized user, otherwise get lost!
___ _____
.’/,-Y” “~-.
l.Y ^.
/\ _\_ “Doh!”
i ___/” “\
| /” “\ o !
l ] o !__./
\ _ _ \.___./ “~\
X \/ \ ___./
( \ ___. _..–~~” ~`-.
` Z,– / \
\__. ( / ______)
\ l /—–~~” /
Y \ /
| “x______.^
| \
j Y
Yes, really nice. I used to change /etc/motd and it used to survive a boot, until I noticed that somewhere, somehow it didn’t anymore, just because /etc/motd was apparently changed into a symlink. At that time, I did not investigate this because of it’s low priority, but now it is fixed. Thanks!
you are very cool please send me your email joe (rmgazelle@hotmail.com) is my email by or good night
RSS feed for comments on this post. TrackBack URL