Linux hide processes from other users and ps command

There is no direct way to hide processes from other users in Linux, as all processes are visible to the root user. However, you can hide a process from other users by changing its name. This can be achieved by using the renice or kill command with the -p option, followed by the PID of the process you want to hide.

For example, to hide a process with PID 12345, you could use the following command:

sudo renice -n 19 -p 12345

This will change the priority of the process, making it less likely to appear in a list of processes.

It is important to note that this method is not foolproof and a determined user can still find the hidden process. Additionally, hiding a process from ps will not prevent other users from seeing it with other tools such as top, lsof, or /proc.

Leave a Comment