Custom Search

Ubuntu server login message

When I first login into Ubuntu server, I got this login message:


Ubuntu login: luzar
Password:
Linux ubuntu 2.6.24-19-server #1 SMP Wed Jun 18 15:18:00 UTC 2008 i686
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/
Last login: Sat Oct 18 12:14:07 2008
luzar@ubuntu:~$

And every time I login I got the same message. Why don't we change the message to something else? The Ubuntu server login message is called motd, stand for message of the day. How do we change the meesage if don't know where it is? We ask Ubuntu:

luzar@ubuntu:~$ whereis motd
motd: /etc/motd.tail /etc/motd /usr/share/man/man5/motd.5.gz
luzar@ubuntu:~$

So, its location is in /etc directory. We know where the location is but how do we edit the message? To edit the message, we use a text editor called vim. Now, please remember some vim basics before we start editing.



  1. No mouse

  2. Use arrow up/down to move the cursor.

  3. i to insert text.

  4. Esc to finish.

  5. dd to delete line

  6. x to delete character.

  7. :q! to force exit without save.

  8. :qw to save and exit.


If you're ready, enter the command below:

luzar@ubuntu:~$ sudo vim /etc/motd
[sudo] password for luzar:

Press enter and you'll see the Ubuntu login message open in vim text editor.


Linux ubuntu 2.6.24-19-server #1 SMP Wed Jun 18 15:18:00 UTC 2008 i686
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/
~
~
~
~
~
"/etc/motd" [readonly] 11 lines, 417 characters

Firstly, we are going to delete all the the login message. It's easier if we delete the whole line. So, place the cursor at the beginning of the first line, and press dd. Repeat until you delete all the message content.


Now we can put whatever we want as a welcome message. Press i to insert data. Type whatever message to pleased yourself and replace the default Ubuntu login message.

Finally, we need to save our new message. Key in this:

This is my machine, so I can do whatever I want.
~
~
~
:wq!

That's all. If anything bad happen, I mean during the editing session in vim editor, please use the basic vim tips I mention before. I know it's quite annoying for a newbie. But you'll get used to it in the near future.


So that's it.

No comments:

Post a Comment

Please keep comment relevant and strictly no spam will be tolerated. Thank you.