Securing and Optimizing a VPS Server.

Hi Guys,

In today’s post we are telling some different ways to make your VPS Server secure in all ways either you say from hackers or from technical jargon if any. Below are some nice ways you should follow in order to secure a VPS Server :-

1 Installing a Root Breach Detector and Email Warning.

If someone does happen to get root, be warned quickly and easily by installing a detector and warning at your inbox directly. You will at least get the hackers/spammers ip address and be warned someone is in there. Server will e-mail you everytime when someone logs in as root .

At command prompt (CMD) type below codes in order to set the above feature:

pico .bash_profile

Scroll down to the end of the file and add the following line also:

echo ‘ALERT – Root Shell Access on:’ `date` `who` | mail -s “Alert: Root Access from `who | awk ‘{print $6}’`” YOUR@email.com

NOTE : Red Text signifies that you have to enter your own mail id in which you want to receive mails.

Now Just Save and all done.

Set an SSH Legal Message :-

To set an SSH legal message, SSH into server and login as root.
At command prompt (CMD) type below codes :
pico /etc/motd

Enter your favourable message and then save.

Message Example : Warning! You are entering a secured area!! Your IP and login information
have been recorded for future refrence . All activities on
this system are recorded and logged.

2 Root kit checker.

Check for root kits and even set a root kit on a cron job. This will show you if anyone has compromised your root. Hackers and spammers will try to find insecure upload forms on your box and then with injection methods, try to upload the root kit on your server. If he can run it, it will modify maximum number of files, possibly causing you to have to reinstall.

To Install root kit, SSH into server and login as root. (Here we are using a very common and nice rootkit, i.e. chrootkit)

At command prompt (CMD) type below codes in order to set the above feature:

cd /root/
wget ftp://ftp.pangeia.com .br/pub/seg/pac/chkrootkit.tar.gz
tar xvzf chkrootkit.tar.gz
cd chkrootkit-0.44
make sense

Now if you want to check chrootkit run following command in CMD.

/root/chkrootkit-0.44/chkrootkit



3 Checking for Formmail.
Form mail is used by hackers to send out spam email, by relay and injection methods. If you are using matts script or a version of it, you may be in danger situation then.

Command to find pesky form mails: 

find / -name “[Ff]orm[mM]ai*”

CGIemail is also a security risk: 

find / -name “[Cc]giemai*”

Command to disable form mails: 

chmod a-rwx /path/to/filename

 
4 Updating Operating System and Softwares:
Updating all softwares as well as OS may result in securing your VPS to some extent, you can update all things by below tut.
 
If you are running cPanel:
 
–Update cPanel: /scripts/upcp
–Update Apache: /scripts/easyapache
 
If you are not running cPanel:
 
–Update OS and software: yum upgrade
 
 
Hope you liked this article. Any issue or fault you are facing then feel free to Contact Us !!
We are here to help you

Add comment

Your email address will not be published. Required fields are marked *