如何在Ubuntu中配置登录消息?


11

每次SSH进入AWS Ubuntu服务器时,都会看到一条系统信息消息,显示负载,内存使用情况和可用于安装的软件包,如下所示:

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 ***

我的问题是,该消息是如何创建的?我该如何配置?

Answers:


11

该登录消息是由Ubuntu的landscape软件包创建的。就我个人而言,我认为它们很烦人,因此,已配置ansible来破坏这些软件包并设置空白的登录消息。

要做到这一点:

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

这将创建一个空白/etc/motd。要设置自定义登录消息,请根据需要编辑该文件。


谢谢@EEAA,这很有帮助。也许您可以帮助我解决一个相关的问题serverfault.com/questions/554021/…–
Andres

@Andres对不起,我不知道。如我的答案所述,我禁用了这些登录消息。我想我的监控系统会告诉我有关CPU或内存的任何问题。
EEAA 2013年

6

就我而言,我必须清除/etc/update-motd.d/51-cloudguest,其内容为:

#!/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"

“必须清除”到底是什么意思?您是完全删除文件“ 51-cloudguest”还是仅删除文件中的全部内容?
PeterCo 2015年

1
IIRC,我将文件留在那里,但删除了其中的内容
空袭2015年

我问是因为标题说:“如果您想避免看到此广告,则可以安全地删除该文件。”
PeterCo 2015年

@PeterCo公平。我想我认为将其保留在那里并不会造成伤害,但仍能达到相同的结果
空袭
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.