首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MOTD很少更新。

MOTD很少更新。
EN

Ask Ubuntu用户
提问于 2014-01-11 06:43:54
回答 1查看 3.2K关注 0票数 7

我知道pam_motd在登录时更新了MOTD,但是有时候MOTD只是几天没有更新,我很困惑是什么原因。我想将uptimewho输出添加到MOTD中,从/etc/update-motd.d/脚本中正确地调用它们,但是如果向用户显示过时的信息似乎是毫无意义的。

来自update-motd手册页:

代码语言:javascript
复制
Executable  scripts  in  /etc/update-motd.d/* are executed by pam_motd(8) as
the root user at each login, and this information is concatenated in /var/run/motd.
The order of script execution is determined by the run-parts(8) --lsbsysinit option
(basically alphabetical order, with a few caveats).

据我理解,MOTD应该在每次登录时更新。但事实并非如此,而且我也找不到手动更新MOTD的脚本。我可以在run-parts中添加一个cron行,但是我不认为它是解决这个问题的正确方法,因为它感觉像是一个黑客或解决方法。

我最后的希望是像这样设置/etc/pam.d/login

代码语言:javascript
复制
# Prints the message of the day upon succesful login.
# (Replaces the `MOTD_FILE' option in login.defs)
# This includes a dynamically generated part from /run/motd.dynamic
# and a static (admin-editable) part from /etc/motd.
#session    optional   pam_motd.so  motd=/run/motd.dynamic noupdate
session    optional   pam_motd.so  motd=/run/motd.dynamic
session    optional   pam_motd.so

我原以为删除noupdate会解决问题,但事实并非如此。

EN

回答 1

Ask Ubuntu用户

发布于 2014-03-29 23:44:15

我最近遇到了同样的问题。您还需要编辑/etc/pam.d/sshd以删除或注释noupdate。

票数 4
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/403788

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档