How to secure your Linux Box

1) Keep the system up to date by applying all the latest update/patches.

Read news websites for bug fix and security updates. Make sure packages are signed and from the know source.

2) Delete or Disable the things you do not require on your server.

Use chkconfig or setup command for Redhat based distribution.

e.g chkconfig –del <service name>

chkconfig –del httpd

To remove packages use the rpm command rpm -e <package name>

Note: check the dependency before removing the package.

3) Setup a firewall using iptables to restricted access.

Use iptables to protect your server from unauthorized access.

e.g. Restricted access to SSH you server running on port 22 from your source IP(from which you ssh the server)

iptables -A INPUT -p tcp -i eth0 -s X.X.X.X -d 0/0 –dport 22 -j ACCEPT where X.X.X.X is source IP from you access your server using SSH running on port 22

4) Implement password policy.

Make sure you always use the strong and good passwords.

Passwords should be at least 8 characters in length and consists of one upper case, number and special character.

Try to avoid reuse of the passwords