登录终端 Ubuntu 14.04 时未显示可用更新

登录终端 Ubuntu 14.04 时未显示可用更新

当我登录到我的服务器终端时ssh我只看到:

Using username "username".
Ubuntu 14.04.1 LTS
Authenticating with public key "mykey" from agent
Last login: Wed Oct 22 09:17:02 2014 from xxx.xxx.xxx.x

登录通常应该告诉我这样的信息:

    Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-33-generic x86_64)
    * Documentation:  https://help.ubuntu.com/
6 packages can be updated.
0 updates are security updates.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

这是为什么呢?我应该如何以及在哪里更改设置以便在登录到终端 shell 时显示可用的更新?

此更新通知工作正常,但大约一周前就停止了。也许我做了一些我不知道的愚蠢更改。

我希望有人能帮助我解决这个问题。

答案1

这就是今天的主题信息 ( motd)。检查文件是否/etc/motd存在且包含内容。输入以下内容:

cat /etc/motd

...您应该看到如下消息:

Welcome to Ubuntu 12.04.4 LTS (GNU/Linux 3.2.0-58-generic x86_64)

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

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

在你的情况下,该文件可能为空。需要安装以下软件包,以便定期更新该文件:

base-files
update-notifier-common 

您可以使用以下命令强制重新创建该文件:

run-parts /etc/update-motd.d/

编辑:

pam_motd 的手册页说有一个名为的标志noupdate可以防止更新 motd。编辑文件/etc/pam.d/sshd。在文件中编辑以下行:

session    optional     pam_motd.so  motd=/run/motd.dynamic noupdate

到:

session    optional     pam_motd.so  motd=/var/run/motd

答案2

本文在 Ubuntu 16.04 上轻松解决了我的问题。除了必须删除并重新创建 /etc/update-motd.d 目录的部分;这似乎是误导。

但基本上:

apt-get install lsb-release figlet update-motd 

似乎在 16.04 上已经为我完成了

相关内容