当前位置: 首页>>技术教程>>正文


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

, , ,

问题描述

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

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

最佳办法

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

要做到这一点:

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

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

次佳办法

就我而言,我必须清除/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"

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/10344.html,未经允许,请勿转载。