在通过SSH连接到一个EC2实例后,我得到一个很好的总结报告 – 你在下面find的。 是否可以用命令显示这个报告?
➜ ~ 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:~$
据我所知,“report”是使用update-motd
生成的传统MOTD(当天消息)login消息的Ubuntu特定dynamic版本。
您可以通过阅读文件/var/run/motd
来访问该报告
从手册:
UNIX / Linux系统pipe理员通常通过在文件
/etc/motd
维护交互式shelllogin名上的pam_motd(8)模块显示的文本来向控制台和远程用户传递重要信息。传统上,此文件是静态文本,通常由分发安装,只在版本升级时更新,或者由本地pipe理员用相关信息覆盖。
Ubuntu引入了更新motd框架,通过这个框架motd(5)从login时的一系列脚本dynamic组合而成。
/etc/update-motd.d/*
中的可执行脚本由pam_motd(8)在每次login时以root用户身份执行,并将此信息连接在/var/run/motd
。
对的,这是可能的。 实际上有一些脚本。 下图显示系统信息,如加载,内存,交换等
/usr/share/landscape/landscape-sysinfo.wrapper
其他脚本可以在这个位置find:
/etc/update-motd.d
这里是他们的完整列表:
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