How to Keep Users’ Processes Private
Learn how to enhance your Linux server’s security by preventing users from viewing each other’s processes.
By default, any user on a Linux server can use commands like top or htop to view all running processes, including those owned by other users.
While this can be useful in certain situations, it can also pose security risks by exposing sensitive information to potential attackers.
Here is how to restrict users from viewing processes owned by other users, thereby enhancing the security of your Linux server.
_I assume you’re working on a properly set-up Ubuntu server. If not, check out my guide on preparing Ubuntu servers _ to get started.
Demonstration
To demonstrate how any user could see processes running by other users, I added a new user named Elie and ran the htop command.

Even with their normal user privileges, Elie is able to see all processes running, including those owned by root and various system users.
Keeping Users’ Processes Private
To keep users’ processes private, you need to add the following line to the end of the /etc/fstab file:
proc /proc proc hidepid=2 0 0Save and close the file.
Then, remount /proc like this:
sudo mount -o remount procNow, let me switch back to Elie and run the htop command again.

As you can see, Elie is now only able to view their own running processes.
The hidepid option with a value of 2 hides information about all running processes owned by other users, including the process directories in the /proc directory.
Conclusion and Final Thoughts
Easy, isn’t it?
Users on your server can no longer read each other’s process lists, which is one less thing a compromised account learns for free.