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.

    *  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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s