如何停止自動建立 ~/.cache/motd.legal 顯示檔?

如何停止自動建立 ~/.cache/motd.legal 顯示檔?

在我的 Ubuntu 伺服器上的每個主目錄中都有一個.cache包含空檔案的資料夾motd.legal-displayed。有沒有辦法停止建立這些.cache資料夾?

答案1

參見man update-motd/etc/update-motd.d

停用模組

查看/etc/pam.d/login並註解掉其中的行session optional pam_motd.so/etc/pam.d/sshd如果 ssh 也是一個問題,您可能也想這樣做。

徹底刪除motd

這將刪除與 motd 相關的任何內容(也是如此motd.legal-displayed):

sudo apt-get remove --purge update-motd

答案2

是的,看起來 motd 檔案現在位於另一個套件中。軟體包 update-motd 說superceded by pam_motd in libpam-modules,由於無法刪除整個 libpam-modules(?),要刪除 motd,我們必須手動刪除檔案:

/lib/i386-linux-gnu/security/pam_motd.so

如果你喜歡:

/usr/share/man/man5/update-motd.5.gz  (libpam-modules)
/usr/share/man/man8/pam_motd.8.gz  (libpam-modules)
/usr/share/base-files/motd  (base-files)
/etc/update-motd.d/  (base-files)
/usr/share/man/man5/motd.5.gz  (manpages)

相關內容