23

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?

1 Answer 1

31

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.

7
  • 2
    This solve the part "being able to list other users running process", but don't understand why this is not this way by default since the beginning. Nov 20, 2015 at 14:57
  • 7
    Because this breaks the Unix way and compatibility with some daemons. Nov 20, 2015 at 15:00
  • 4
    It's just an old tradition that a timesharing system would be an open community.
    – Barmar
    Nov 25, 2015 at 19:53
  • If Mr. Bad Guy got to run programs on your system, it is game over anyway. This is just hiding stuff that is vital for normal functioning of the system. to give a cracker a bit of a nuisance. "Security theater" at it's most glorious.
    – vonbrand
    Feb 16, 2016 at 0:33
  • 1
    This should absolutely be the default. People should be able to see root-level processes, so this shouldn't break any daemons, to them the computer is identical to as if the other users didn't exist. This has nothing to security, but overwhelmingly privacy. Many workplaces and universities have multiuser systems, and with the Linux default you can easily see exactly what everyone else is doing. Unfortunately I don't think many people understand this, so while losing privacy is one thing, losing it without knowing its lost is another. Sep 18, 2019 at 3:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.