Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
any security tips for my first server? (complete beginner)

I'm a programmer not a System administrator. I just joined a new company but they expect me to manage their server too. I only know a little about linux systems and commands.

I am concerned about the security of our server. Does anyone have a checklist of what to do to ensure that it is properly secured?

nb: I use centos, and lamp server, cpanel included.

share|improve this question

marked as duplicate by sysadmin1138 Apr 15 '11 at 15:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
Have a look at the answers to this question to get yourself started –  Iain Apr 15 '11 at 13:14
1  
Next time, search for related questions first. Some guy already asked almost exactly your question, including what software he was running. –  Caleb Apr 15 '11 at 13:53
add comment

3 Answers

From a previous answer of mine:

  • Shut down the services you don't need

If you don't need a specific service, shut it down. One thing less to worry about, especially regarding security.

  • Follow the least privilege principle

If a service does not need to have super privileges, just give it the privileges it needs. For instance, if your web application doesn't need to drop tables, there's no need to enable the drop privilege in MySQL.

  • Have your services updated regarding security updates

This is very important! From time to time, security holes are discovered. It's very important to have your applications updated when it comes to security issues.

  • Don't use default credentials

Just don't use it. They're evil :) For instance, MySQL's root user doesn't have a password. Create one.

  • Backup everything that's important

Backup everything you need to rebuild your server, and I mean everything. Also, test your backups on a regular basis. This is valid not only for security reasons, but also for business continuity reasons. One never knows when a backup might be needed.

Hope this helps!

share|improve this answer
add comment

Here just one small thing expands the points from Jonathan.

  • If you have SSH, use secure passwords, or better, keys to login.
  • Change the SSH-Port to another number like 222. Most people test Port 22 and attack them if its open.
share|improve this answer
    
And if ssh is open to the outside world, limit which accounts can login that way, make sure those accounts have strong passwords and implement fail2ban to prevent brute force password attacks. You WILL see a brute force attack regularly. –  uSlackr Apr 15 '11 at 13:19
add comment

Here's a very quick rundown of what's quite a complex area: Secure Linux. Although it mentions workstations, the same principles apply. The notes at the bottom are important:

Keep your system up-to-date, especially when security vulnerabilities appear in packages you use. All major Linux distros have security mailing lists, subscribe to your distro's.

Disable services you don't need. Every open service makes your system m> ore open to attacks.

Regularly monitor the logs.

share|improve this answer
add comment

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