I have implemented SSH rsa key pair for authentication to my linux server (root access is also disabled). Apart from that I have configured iptables to access particular ports by specific ip addresses only. What more I can do to harden the security to my linux servers?

  • 3
    1. Put server in basement 2. Remove network cable. 3. Switch it off. 4. Unplug it. 5. Encase it in concrete. Your server is now reasonably secure and still performs all the functions you told us it needs to perform. Dec 1, 2017 at 7:22
  • 1
    Think about utilising SELinux and systemd's built in cgroup management. Think about Intrusion Detection systems i.e. fail2ban and anti-virus such as clamav. Think about proactive system monitoring with something like Nagios so that you can pick up any irregularities before they become major issues Dec 1, 2017 at 9:13

1 Answer 1


That's a good start, but the list really is endless and depends on what your server will be used for, how it will be accessed, and when, amongst other things.

I recommend using audit software that you install on your server. It will scan your server and give you a score out of 100 as well as provide information on how to harden your server to be more secure. The tool is called lynis, it can be found here:


If you want to go a bit deeper you can take a look at this linux security expert website:


Not all servers are created equal in terms of their security requirements, so as stated above decide what functions and services your server needs to provide and remove any functions or services from the server that won't be used. Once you have done that then install the auditing tool and see the results of running an audit on your server. Study the results and see if any of the recommendations would suit you setup and implement them accordingly.

Keep your server patched by installing security updates often. Limit access to the server to a select few. Make sure you have audit trails in place, the list of hardening possibilities is vast - have fun!

Not the answer you're looking for? Browse other questions tagged or ask your own question.