Using ps -aux or top, I can list other users running processes, but I’m neither running as root nor making use of sudo, why?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
By default, you can always list other users processes in Linux.
To change that, you need to mount proc in /etc/fstab with hidepid=2:
proc /proc proc defaults,hidepid=2
This functionality is supported from the kernel v3.2 onwards. It hides /proc and consequentially ps activity from all users except root.
Taken from this article about hidepid:
hidepid=2 – It means hidepid=1 plus all /proc/PID/ will be invisible
to other users. It compicates intruder’s task of gathering info about
running processes, whether some daemon runs with elevated privileges,
whether another user runs some sensitive program, whether other users
run any program at all, etc.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0