For security and privacy reasons, I want to stop logging logins, as well as hiding information about currently logged-in users.
So far, I tried revoking reading permissions to utmp and wtmp:
sudo chmod o-r /var/run/utmp sudo chmod o-r /var/log/wtmp Which successfully stops w and who commands from working. They return without information about other users.
However, as demonstrated in the answer in "Other users are logged in" how does the system know? Where is the information leaking? it is still possible to access the information about other logged-in users via a DBus call to systemd-logind or elogind.
How can I disable this specific DBus call? Or, in general, how can I prevent normal users from being able to look up other logged-in users?
psandtop.ls -l /procis also a problem. Last update of/home/usercould also leak information. If you really want to keep every user from knowing about other users the best best is a vm or container specific to each user.