13

Each time I SSH into my AWS Ubuntu servers I see a system information message, showing load, memory usage and packages available to install, like this:

Welcome to Ubuntu 12.04.3 LTS (GNU/Linux 3.2.0-51-virtual x86_64)

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

  System information as of Sun Nov 10 18:06:43 EST 2013

  System load:  0.08              Processes:           127
  Usage of /:   4.9% of 98.43GB   Users logged in:     1
  Memory usage: 69%               IP address for eth0: 10.236.136.233
  Swap usage:   100%

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

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

Get cloud support with Ubuntu Advantage Cloud Guest
  http://www.ubuntu.com/business/services/cloud

Use Juju to deploy your cloud instances and workloads.
  https://juju.ubuntu.com/#cloud-precise
*** /dev/xvda1 will be checked for errors at next reboot ***

*** System restart required ***

My question is, how is that message created? How can I configure it?

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
Andres
  • 239
  • 4
  • 9
  • To hide it [you can just `touch ~/.hushlogin`](https://debian-administration.org/article/546/Giving_yourself_a_quieter_SSH_login) – Pablo A Jun 18 '20 at 07:20

3 Answers3

12

This login message is created by Ubuntu's landscape packages. Speaking personally, I think they're quite annoying and as such, have configured ansible to nuke those packages and set a blank login message.

To do that:

$ apt-get remove landscape-client landscape-common 
$ rm -f /etc/motd && touch /etc/motd

That will create a blank /etc/motd. To set a custom login message, edit that file as desired.

EEAA
  • 108,414
  • 18
  • 172
  • 242
  • Thank you @EEAA, that was helpful. Maybe you'll be able to help me with a related question http://serverfault.com/questions/554021/why-the-system-information-message-when-accessing-an-ubuntu-server-doesnt-match?rq=1 – Andres Nov 10 '13 at 23:48
  • @Andres Sorry, I have no idea. As mentioned in my answer, I disable these login messages. I figure my monitoring system will tell me if there are any issues with regards to CPU or memory. – EEAA Nov 11 '13 at 00:08
8

In my case, I had to clear /etc/update-motd.d/51-cloudguest, which read:

#!/bin/sh
#
# This file is written by the Ubuntu image build process, it is not
# managed by a package.  If you want to avoid seeing this advertisement,
# then you can safely remove the file.
echo ""
echo "  Get cloud support with Ubuntu Advantage Cloud Guest:"
echo "    http://www.ubuntu.com/business/services/cloud"
echo ""
echo "  Use Juju to deploy your cloud instances and workloads:"
echo "    https://juju.ubuntu.com/#cloud-saucy"
Melebius
  • 139
  • 8
airstrike
  • 185
  • 1
  • 5
  • What exactly do you mean with "had to clear"? Do you delete the file '51-cloudguest' completely or do you just delete the entire content in the file? – PeterCo Dec 03 '15 at 09:45
  • 1
    IIRC I left the file there but deleted the contents – airstrike Dec 03 '15 at 09:46
  • I ask because the header says: "if you want to avoid seeing this advertisement then you can safely remove the file." – PeterCo Dec 03 '15 at 09:52
  • @PeterCo Fair enough. I guess I figured keeping it there wouldn't hurt and still achieve the same result – airstrike Dec 20 '16 at 22:06
1

Although already answered, I'd like to add a different approach: Since I find (many of the) dynamically generated infos quite useful, I prefer to not delete the entire motd or uninstall the landscape package, because I am not doing this administation stuff every day.

Ubuntu stores dynamic motd in "/etc/update-motd.d/" folder. So, to disable entire motd, just remove eXecute permissions on the respective scripts:

    $ sudo chmod -x /etc/update-motd.d/*

or do this on a per script basis, e.g.

    $ sudo chmod -x /etc/update-motd.d/10-help-text

in order to just disable a single section (e.g. the help-text). You get the section back by issuing the chmod +x command. See the description in Disable dynamic motd and news on Ubuntu ...

You can also shrink the quite lengthy "System information" output to fit your needs, e.g.

System information as of Mon 27 Dec 2021 05:26:42 PM CET

IPv4 address for enp3s0: 192.168.0.10   Temperature: 36.0 C

by adding a config section to the /etc/landscape/client.conf file:

[sysinfo]
sysinfo_plugins = Network, Temperature

See the landscape-sysinfo(1) man page for details about that config.

Hope this helps.

Sarge1060
  • 11
  • 1