0

After connecting to an EC2 instance via SSH I get a nice summary report shown - the one you find below. Is it possible to display this report with a command?

➜  ~ ssh ...
Warning: the ECDSA host key for 'example.net' differs from the key for the IP address '12.34.56.78'
Offending key for IP in /home/user/.ssh/known_hosts:30
Matching host key in /home/user/.ssh/known_hosts:66
Are you sure you want to continue connecting (yes/no)? yes
Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-59-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Feb  6 10:03:28 UTC 2017

  System load:  0.66               Processes:           155
  Usage of /:   43.0% of 49.08GB   Users logged in:     0
  Memory usage: 1%                 IP address for eth0: 172.12.34.56
  Swap usage:   0%

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

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

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


*** System restart required ***
Last login: Mon Feb  6 09:20:51 2017 from 31.19.89.2
ubuntu@ip-172-12-34-56:~$ 

2 Answers 2

1

As far as I know that "report" is an Ubuntu specific dynamic version of the traditional MOTD (message of the day) login message that gets generated with update-motd.

You can simply access that report by reading the file /var/run/motd

From the manual:

UNIX/Linux system adminstrators often communicate important information to console and remote users by maintaining text in the file /etc/motd, which is displayed by the pam_motd(8) module on interactive shell logins.

Traditionally, this file is static text, typically installed by the distribution and only updated on release upgrades, or overwritten by the local administrator with pertinent information.

Ubuntu introduced the update-motd framework, by which the motd(5) is dynamically assembled from a collection of scripts at login.

Executable scripts in /etc/update-motd.d/* are executed by pam_motd(8) as the root user at each login, and this information is concatenated in /var/run/motd.

2

Yes it is possible. There are in fact some scripts. The one bellow displays system information like load, memory, swap etc

/usr/share/landscape/landscape-sysinfo.wrapper

The other scripts can be found on this location:

/etc/update-motd.d

Here is a full list with them:

4 -rwxr-xr-x   1 root root 1220 Feb 20  2014 00-header
4 -rwxr-xr-x   1 root root 1358 Feb 20  2014 10-help-text
0 lrwxrwxrwx   1 root root   46 Jan 14  2016 50-landscape-sysinfo -> /usr/share/landscape/landscape-sysinfo.wrapper
4 -rwxr-xr-x   1 root root  334 Jan 14  2016 51-cloudguest
4 -rwxr-xr-x   1 root root  149 Aug 22  2011 90-updates-available
4 -rwxr-xr-x   1 root root  299 Nov 13  2014 91-release-upgrade
4 -rwxr-xr-x   1 root root  129 Aug  5  2016 95-hwe-eol
4 -rwxr-xr-x   1 root root  111 Jun  3  2015 97-overlayroot
4 -rwxr-xr-x   1 root root  142 Aug 22  2011 98-fsck-at-reboot
4 -rwxr-xr-x   1 root root  144 Aug 22  2011 98-reboot-required

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .