MOTD 尚未被完整查看

MOTD 尚未被完整查看

这是我的问题。当我以 root 身份通过 ssh 登录到我的 ubuntu 14.04.2 VM 时,我看到了

[skynet]~> ssh gm-st01
Ubuntu 14.04.2 LTS gm-st01.name.lab ssh-pty

No mail.
Last login: Fri May 15 16:23:02 2015 from skynet.name.lab

[gm-st01]~> run-parts /etc/update-motd.d/
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-52-generic x86_64)

                                 _    ___  _  
        __ _ _ __ ___        ___| |_ / _ \/ | 
       / _` | '_ ` _ \ _____/ __| __| | | | | 
      | (_| | | | | | |_____\__ \ |_| |_| | | 
       \__, |_| |_| |_|     |___/\__|\___/|_| 
       |___/                                  

  System information as of Fri May 15 16:34:23 AMT 2015

  System load:  0.0                Processes:           190
  Usage of /:   10.2% of 23.19GB   Users logged in:     1
  Memory usage: 1%                 IP address for p1p1: 10.24.20.129
  Swap usage:   0%

[gm-st01]~>cat /etc/ssh/sshd_config
PrintMotd yes # with no everything is the same
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
UsePAM yes

[gm-st01]~> cat /etc/pam.d/login | grep pam_motd
session    optional   pam_motd.so  motd=/run/motd.dynamic noupdate
session    optional   pam_motd.so

也许这也有用

[gm-st01]~> cat /etc/hosts
127.0.0.1   localhost
127.0.1.1   gm-st01
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

[gm-st01]~> cat /etc/hostname 
gm-st01.name.lab

答案1

我通过将以下 lint 添加到 /etc/pam.d/sshd 来修复此问题

会话可选 pam_motd.so motd=/run/motd.dynamic noupdate

相关内容