In every home-directory on my Ubuntu Server is a .cache
folder containing an empty file motd.legal-displayed
. Is there a way to stop creating these .cache
folders?
2 Answers
See man update-motd
and /etc/update-motd.d
Disable motd
See /etc/pam.d/login
and comment out the line that has session optional pam_motd.so
in it. You might also want to do this in /etc/pam.d/sshd
if ssh is also a concern.
Completely remove motd
This will remove anything related to motd (so also motd.legal-displayed
):
sudo apt-get remove --purge update-motd
-
I commented out these two lines and no more .cache folders were created. However, the complete removal of motd did not work.– ph3nxFeb 14, 2013 at 23:32
-
-
No that's not the problem I'm logged in as root. It says
Package update-motd is not installed, so not removed
.– ph3nxFeb 15, 2013 at 14:12 -
Aha. Then it is weird you had that file and the config file on your system. Then again: the purge is not required anyways ;)– RinzwindFeb 15, 2013 at 14:15
-
Yes it's weird! Thanks for your help, commenting out these lines solved my problem :)– ph3nxFeb 15, 2013 at 14:16
Yeah, it seems the motd files now live inside another package instead. Package update-motd says superceded by pam_motd in libpam-modules
and since whole libpam-modules can't be removed (?), to remove motd we have to remove the files manually:
/lib/i386-linux-gnu/security/pam_motd.so
and if you like:
/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)
motd.legal-displayed
?.cache
folder in your home directory is used by lots of different things, so I wouldn't try to delete it unless I needed to free disk space. It's safe to delete it if you're willing to sacrifice performance. See the XDG base directory specification