Posts Under Category: Security

Wordpress security
I am seeing a lot of WordPress wp-login.php brute force attack these days. In this tutorial I will explain how to stop wp-login.php attack on a cPanel server. read more

For security reason it is recommended that you disable root SSH login to server. To SSH your server with root privileges you should create a new user and assign root privileges to this new user.

In this tutorial, we will assign root privileges to a new user ravi on a CentOS server.
read more

The main user / administrator of a Linux server is root. Here is how you can create a new user on your CentOS server / VPS.

Login to your server as root as run following command to create a new user named ravi.

/usr/sbin/adduser ravi

Now set password for new user ravi

passwd ravi

Screenshot

add-new-user

Done!!

read more

I was recently installing and configuring a new server. After installing CentOS I installed Apache. But server IP was not opening default Apache page. I was getting ping reply from my computer to server IP. So, I quickly figured out that Port 80 and Port 224 on server are blocked for incoming web traffic.

we need to open port 80 (http port) and port 443 (SSL / https port) for web traffic. So, here is how you can open port 80 and 443 on your server.

Login to your server as root via SSH and run following commands:

iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
/etc/init.d/iptables save
/etc/init.d/iptables restart

Done!!!

Our Recommended VPS Hosting

You can protect your server from XMAS Attacks and drop incoming malformed XMAS packets by applying following rule in IPTable.

Login to your server via SSH as root and run following commands:

iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
/etc/init.d/iptables save
/etc/init.d/iptables restart

Done!!

read more

Syn-flood attacks are common these days. Syn-flood attack means that the attackers open a new connection to the server, but do not state what they want. They just want to take up servers resources and increase server load.

This type of attack can be controlled by adding a rule in IPTable to reject syn-flood attacks. Login to your server as root via SSH, and run following commands:
read more

For security reason, you should block all incoming null packets requests to your server. All TCP requests with flag NONE to your server should be blocked. These are generally bad bots looking for security holes on your server to exploit. This can be easily done by adding a rule in IPTable / firewall.

Login to your server as root via SSH and run following command:

iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
sudo /etc/init.d/iptables save
sudo /etc/init.d/iptables restart

This works on a CentOS / RedHat Linux server.

Our Recommended VPS Hosting

For security reason, it is recommended that you disable directory listings / indexing on your server. Apache default configuration comes with this feature enabled but its always a good idea to get it disabled unless you really need it.

When this option is enabled, user can see the list of files / folder of a directory when no index file is present.
apache-directory-index

With Apache listings / indexing option disabled, user will not be able to see content of a directory in absence of a index file.

Here is how you can disable this on a cPanel server.

Step 1

Login to your server WHM as root.

Step 2

Navigate to:
WHM Main >> Service Configuration >> Apache Configuration >> Global Configuration

Step 3

Under Directory ‘/’ Options >> uncheck Indexes >> Save >> Restart Apache

apache-directory-index-2

Done!!

Our Recommended VPS Hosting

This tutorial explains how you can start and stop firewall on a CentOS / RedHat Linux server.

How to Stop / Disable firewall

Below commands will stop / disable firewall of a redhat / centos server. Login to your server as root via SSH and run following commands:

service iptables save
service iptables stop
chkconfig iptables off

For IPv6 firewall, use below commands:

service ip6tables save
service ip6tables stop
chkconfig ip6tables off

How to start firewall

Run below commands to start firewall.

chkconfig iptables on
service iptables start

For IPv6 firewall, use below commands:

chkconfig ip6tables on
service ip6tables start

Our Recommended VPS Hosting

This tutorial explains how you can list all current iptables rules on a RedHat / CentOS Linux server, and how you can clear / flush current iptables rules.

How to list current iptables rules

Below command will list of current iptables rules of your CentOS / RedHat Linux server.

iptables -L

How to Clear / Flush iptables rules

Use below command to delete / clear / flush all current iptables rules of your CentOS / RedHat Linux server.

iptables -F

If your server went down after flushing iptables, please refer to following tutorials:
Solution – Server Down after Flushing IPtables

Our Recommended VPS Hosting