Essential security tips for servers

In this tutorial you will find out some of the necessary steps to secure you VPS or dedicated server.

1. First thing you need to do is to change your root password. Connect to server with SSH and type:
[quote]passwd[/quote]
Then type in your new password, press enter, and retype it again.

2. It’s not safe to allow root user to login throught SSH. So you need to create a new user:
[quote]useradd user_name[/quote]
Then set the password for this user with:
[quote]passwd user_name[/quote]
3. Now let’s go to SSH settings.

Import rules to iptables:
[quote]iptables-restore < /etc/iptables.rules[/quote]
5. Set new iptables rules to reset during reboots:
[quote]sudo nano /etc/network/interfaces[/quote]
[quote]…
auto lo
iface lo inet loopback
pre-up iptables-restore < /etc/iptables.rules
…[/quote]
6. And now reload SSH server:
[quote]sudo /etc/init.d/ssh reload[/quote]
These are only essential steps to secure you server. Your server should now be a little bit more secure, but there is no such thing as 100% security.