Any server or device with a public IP address becomes a target for attackers. Therefore, it is of utmost importance to harden the security in order to neutralize any malicious activity, here are 12 tips that will help you improve the security of your server.
- Install your server in text mode, this will guarantee greater security and performance.
- Keep your operating system and other applications updated.
- Create strong passwords resistant to brute force attacks.
- Disable root user access via SSH. Most of the attackers use zombie machines and execute brute force attacks against common users such as: root, admin, super, … hence using a difficult to guess user increases server security.
- Create a user with administrative privileges and that the user’s login don’t be common, this is the user that you will use to connect via SSH.
- Disable password authentication via SSH, use only public and private keys for this purpose. Public and private keys authentication improves security and it frees the users from remembering complicated passwords.
- Disable / uninstall services and applications that are not used.
- Deploy a firewall in order to protect the server from malicious activity.
- Keep open only public ports like 80 and 443, close all others.
- Implement rules that protect your server against DDOS-like attacks.
- Deploy an Intrusion Prevention System such as fail2ban, fail2ban will block any malicious activity for a certain time, for example block all IPs that have made X unsuccessful authentication attempts via SSH.
- Protect your Apache server by installing the mod_security module.
- Protect your websites with SSL, using Let’s encrypt.
- Protect your MySQL DB server using ProxySQL