Every time I connect to my home server through my ssh client, I receive the same message and I’m getting bored of seeing it, so I decided to change the message to something else.

Here’s the message that I get every time:

Last login: Wed Jul  8 16:35:28 2009 from 192.168.2.3
Linux localhost 2.6.20-15-server #2 SMP Sun Apr 15 07:41:34 UTC 2007 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.
root@localhost:~#

Changing this message requires editing two different files. The first three sections can be modified by editing the following file:

  nano  /etc/motd

This file contains the linux build number as well as the Ubuntu warranty message. I don’t find this particularly useful, so I removed all of it and replaced it with my own message.

To disable the last login message (which I don’t recommend doing), you will need to edit the following file in sudo mode:

  nano  /etc/ssh/sshd_config

Find this line in the file and change the yes to no as shown:

    PrintLastLog no

Now when you login, you’ll get a blank prompt, although I wouldn’t necessarily recommend it because it’s useful to see the last login to the system for security reasons. This is my prompt now:

Last login: Wed Jul  8 17:05:12 2009 from 192.168.2.3
OMG!! You killed kenny! You BASTARD!
 
             _..-""""-.._
           .'            '.
          /     _...._     \
         /  ,=";_.''._;"=,  \
        ;  /  /  `\/`  \  \  ;
        |  |  |  '/\'  |  |  |
        |  |  \..'  '../  |  |
         ;  \  \      / .'  ;
          \  '._-.__.-_.'  /
          /'.   ``|\``   .'\
         /   `'-../.).-'`   \
        |_                  _|
       (  \                /  )
        '-/                \-'
          |________________|
          (________.________)
 
root@localhost:~#