Hardening Linux servers for remote access

Hardening Linux servers for remote access

I host several Linux servers which allow users remote access and file transfer capabilities via SSHv2/SFTP. These systems are already hardened with external firewalls, SSH hardening ala DenyHosts and internal privilege hardening via Bastille, limits.conf and some of my own hand-rolled scripts. Is there anything you might recommend to further tighten such a setup, since many users will have shell access?

    Requires Free Membership to View

    When you register, my team of editors will also send you resources covering Linux administration and management; integration and interoperability between Linux, Windows and Unix; securing Linux and mixed-platform environments; and migrating to Linux.

    Cathleen A. Gagne, Senior Editorial Director

    By submitting your registration information to SearchEnterpriseLinux.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchEnterpriseLinux.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

It sounds like you've got most of the bases covered. I have a few suggestions that may assist you:

  • Look at PAM and potentially how to use it to harden your user controls. Strong passwords and authentication controls are critical on hosts with large numbers of shell users.
  • Consider a deployment of SELinux (or depending on your platform AppArmor). While both can be complicated to configure they can be very powerful in adding more granular controls to your hosts.
  • Consider very carefully what packages are installed, for example, if a lot of users have shell access then the addition of tools like compilers and scripting languages can greatly assist an attacker in compromising your host. Ensure you have the minimal and most appropriate set of packages installed.
  • Often the first warnings of something going wrong is a log message. Try setting up some centralized logging and alerting on some of the more critical messages for security and operations and consider the use of tools like SEC or Swatch, which are helpful with this.
  • Lastly, ensure you keep up to date with patches and updates for both your operating system and your applications.
  • Hope that helps and good luck with securing your hosts.

    This was first published in January 2008