Thursday, May 9, 2013

Change SSH Welcome Banner on Ubuntu


Change SSH Welcome Banner on Ubuntu


Every time I connect to my Ubuntu development server through my ssh client, I receive the same message and I’m getting tired of seeing it, so I decided to change the message to something else.
Here’s the message that I get every time:
Welcome to Ubuntu 13.04 (GNU/Linux 3.8.0-19-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Thu May  9 07:37:21 CDT 2013

  System load:  0.01               Processes:           88
  Usage of /:   17.4% of 14.64GB   Users logged in:     0
  Memory usage: 34%                IP address for eth0: 10.14.186.85
  Swap usage:   0%

  Graph this data and manage this system at https://landscape.canonical.com/

0 packages can be updated.
0 updates are security updates.

New release '13.04' available.
Run 'do-release-upgrade' to upgrade to it.


Last login: Mon Aug 13 01:05:46 2007 from ipaddress removed
root@test:~$
Changing this message requires editing two different files. The first three sections can be modified by editing the following file:
/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:
/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:
Welcome to Ubuntu 13.04 (GNU/Linux 3.8.0-19-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Thu May  9 07:37:21 CDT 2013

  System load:  0.01               Processes:           88
  Usage of /:   17.4% of 14.64GB   Users logged in:     0
  Memory usage: 34%                IP address for eth0: 10.14.186.85
  Swap usage:   0%

  Graph this data and manage this system at https://landscape.canonical.com/


root@test:~$
Linux is really great.

No comments:

Post a Comment