Webhostingchat is an open, friendly place for providers, technology junkies and those looking for hosting come to gather and discuss hosting, dedicated server, colocation, VPS , Cloud Hosting and Virtualization. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us

Simple Method of securing server

Hey this is very simple and it will not secure your server 100%. These are the basic steps that you should take with each server. Please understand that I am not responsible if you get hacked when you using this method as to keep your system secure you need to keep everthing uptodate and even then it is not full proof.

Update the server

- This is very important that everything is uptodate. If it isnt up to date there are going to be weaknesses in it. Do a full cPanel/WHM upgrade to the latest stable version. You should also set up a cron job so that it attempts to update cpanel/WMH nightly. This will keep the system up2date.

- We are going to disable the direct login so that you have to guess 2 passwords to hack in and also change the port so they will have anouther variable to guess.

pico /etc/ssh/sshd_config

Press "Ctrl + W" and type: "#Port 22". Then uncomment this line and change "22" to some RANDOM high port. Make sure you record this as there is no turning back. You will NOT be able to connect to port 22 again.

Press "Ctrl + W" again and type: "#Protocol 2, 1". Uncomment this line and make it "Protocol 2". Protocol 1 is insecure and hence we force the use of Protocol 2. Then save the file.

Now you need to create a username for SSH. What I do is create a subdomain of the main domain on the server and use a cryptic username that you can remember. Then add this to the wheel group in WHM for SSH users. NOTE THIS IS IMPORTANT AS YOU WONT BE ABLE TO 'su -' OTHERWISE.

Now connect back to SSH (old port)

pico /etc/ssh/sshd_config

Press "CTRL + W" and type: "#PermitRootLogin yes". Uncomment this and change it to "PermitRootLogin no". Then save the file.

Then type /etc/rc.d/init.d/sshd restart

This will restart SSH and put all the changes into effect. Now SSH is secure and to login you have to login via the username on the wheel group and type "su -" and then the root password to get into root.

Alert on root login

- This is an important step as we need to monitor who is logging in. If we dont know they are logging in then they shouldnt be so we need to stop it.

To do this type

pico .bash_profile

You must be logged in as root (or su'ed) and must be in the /root directory

to the end of the file. I would advise the email is off server so that the hacker would have to hack 2 seperate servers to hide his enterance

Disable Telnet

- Telnet is insecure and it sends passwords via insecure means. (Open text). so we need to remove it

Type pico /etc/xinetd.d/telnet

Change the disable = no to disable = yes

if this line doesnt exist add it. Save and exit the file and then restart it.
/etc/xinetd.d/xinetd restart

Install APF firewall

- You need a firewall to stop unwanted traffic. If you dont install this people can use your server for IRC bots etc. I wont write a guide for this as there are so many out there. I would advise you look at webhostgear.com as last I checked they had a guide

Install ExiScan + ClamAV

- You need to have an anti-virus and mailscanner and this is the best one out there. There are many methods of install and I would advise you learn to do the more advanced install. I wont teach you that as that could be an article in itself. Instead ill give you a link to an autoinstaller

to the end of the file. I again advise that this email is an offserver email. Type

chmod +x /etc/cron.daily/rkhunter.sh

That is it really.... Its very very basic but its a start. I could write for a whole day on what to do but then there would be no point in hiring my company (that and I dont have the time). I hope I have helped. Please feel free to ask any questions at all..