securing ps to keep normal users from reading all the processes

This is one way we secure ps to keep normal users from reading all the processes on the server. We know there are other ways to do this and if you would like to share please do.</p>

    *  Moving ps

   1. mv /bin/ps /usr

    * Editing new ps

   1. vi /bin/ps
   2. We are creating a bash script listed below:

#!/bin/bash

if [ "$(whoami)" != "root" ]; then/usr/ps x

fi

if [ "$(whoami)" = "root" ]; then

/usr/ps $1

fi

    * Allowing ps to run

   1. chmod +x /bin/ps

su - into a normal users login and try and use ps -aux should default and make user ps x

comments powered by Disqus