Results 1 to 15 of 15
  1. #1

    * How to secure and harden centos linux server from vulnerabilities & threats ,attacks?


    I am newbie to linux, I've a dedicated box.
    How I can secure my server from vulnerabilities and threats and ddos attack? How can I find my server is compromised or hacked?

    Which ports I should check, what commands I should fired on shell prompt? which softwares you will recommend.

    Help will be appreciated

  2. #2
    Join Date
    Dec 2002
    Do yourself a favor and install CSF firewall. It will cover the majority of your concerns.

    log into your server via root and execute these commands.

    rm -fv csf.tgz
    tar zxf csf.tgz
    cd csf
    Once your done, log into Cpanel and configure to your hearts content.

    See this sample admin page:

  3. #3
    Thanks lot Frontpage

    I've installed Csf firewall.

    Which commands is used for check unknown ports and how to find ddos attack(commands)?
    what will be preventive permission for files folders?

    Is there any source guide available for help to harden and secure server from attacks and vulnerabilities ?

  4. #4
    Join Date
    Dec 2002
    CSF will prevent many common attacks and probes automatically by blacklisting the offending IP address. Make sure you have mod_security installed as well with a good rule set which will cover many other common hack attempts.

  5. #5
    Join Date
    Oct 2007

    Also don't forget kernel security

    CSF is fine but if some one is going to get in through an exploit in the kernel, CSF will not prevent that.

    To harden your system:

    1. Compile and install a high security module-less grsec kernel. See grsec here:

    2. Install CSF and configure it.

    3. Remove all unwanted user accounts and groups.

    4. Install and configure proper security measures such as modsecurity and dosdeflate for apache.

    5. Restrict SSH to just the users that need to SSH and always disable root login from SSH. Perform other SSH tightening measures.

    6. Secure your other software such as mail servers, ftp servers etc. This depends on what you are using - exim, postfix,sendmail etc.

    7. Password protect the mysql root login. Remove the test database. Allow mysql database only to the web server system that needs it. If your mysql is on the same system as your webserver, you should block mysql port from external access.

    8. Install rkhunter and configure it to scan and send daily reports to you.

    9. Install either aide or tripwire and configure it to scan all system files daily and report changes to you.

    10. Install logwatch and configure it to send daily log reports to you.

    10. Install bastille and harden the system.

    11. Once you are done setting up and configuring the system, remove all un-needed packages. Also remove all compilers from the system.

    12. As a last step, chattr +a the root bash shell history file and also chattr -R -i the whole of /usr/sbin, /bin, /sbin, /usr/sbin/ , /usr/local/bin and /usr/local/sbin.

    Your system should be sufficiently hardened now.

    Remember security is not a one time job. It is a life long process so make sure to read up on the latest threats, the new security tools etc.

    God bless you.
    "For I know the plans I have for you" declares our Lord Jesus Christ, "they are plans to prosper you, to give you a hope and a future and not to destroy you." - Jeremiah 29:11

  6. #6
    You should update centos packages with

    yum update
    I will mostly do install csf, change ssh port, also only allow ssh connection from my ip.

    Also do things technichristian posted. I never done many of the things, like grsec kernel, if you do, your server will be more secure.

  7. #7
    for securing your server,

    *Use secure protocol whenever possible.
    *whenever possible Serve only one type of network per machine.
    *Moniter all servers carefully for suspicious activity.
    Support Facility | 24/7 web hosting technical support services
    Technical support | Server management | Data migration

    Technical Articles

  8. #8
    Thanks all,

    I would like to thank technichristian for server security tips.

    My question is, what basic commands is used for security checks? For example netstat command.

  9. #9
    use chkrootkit and rkhunter to scan your server for any root kit Half Dedicated Half Price
    We provide affordable VPS hosting solution Singapore datacenter

  10. #10
    Join Date
    Nov 2001
    One of the most effective things you can do to secure a server is to remove PHP and therefore all PHP applications. In doing so you'll avoid quite a few of the commonly exploited applications. Of course, depending on the intended purpose of the machine, it may not be that useful to you in that state.

    Said only half in jest.
    “Even those who arrange and design shrubberies are under
    considerable economic stress at this period in history.”

  11. #11
    Also use an IDS, I recommend OSSEC because of the active-response function, when OSSEC detects an attack the source IP is added to ipfilter deny list... all thru CSF has similar features too

  12. #12
    Join Date
    Jun 2009
    Nice, but i prefer Mod Security firewall.Also about DDOS you cant be protected by any program. .
    Freelancer Linux System Administrator

  13. #13
    Join Date
    Feb 2004
    Bay Area, CA
    After an initial CentOS install I like to use Lynis ( and Rootkit Hunter ( to help find places that might help improve security.

    I also make sure to only install what is needed, install and configure APF and BFD also (CSF is probably similar in combining APF and BFD features).

  14. #14
    Join Date
    Sep 2007
    You should get a server admin to secure your server. You can check offers here. Many companies provide one time server admin job.
    All things work together for the good of those who love God - Romans 8:28

  15. #15
    Join Date
    Nov 2004
    If you don't know what you're doing, get either ConfigServer or Platinum Servers (name not right) to harden your server. A hundred dollars or so of help from an expert at the start will save you many hundreds of wasted time and effort over time.

Similar Threads

  1. How can I secure my server again spam attacks?
    By Zaggs in forum Hosting Security and Technology
    Replies: 5
    Last Post: 03-26-2008, 12:30 AM
  2. Secure my server from DoS attacks
    By albano in forum Systems Management Requests
    Replies: 11
    Last Post: 04-15-2007, 09:36 PM
  3. How to secure harden the server?
    By scorpiox in forum Hosting Security and Technology
    Replies: 5
    Last Post: 03-28-2007, 09:42 PM
  4. What do you do/install to harden/secure your server ?
    By neiq in forum Hosting Security and Technology
    Replies: 2
    Last Post: 08-18-2006, 04:25 PM
  5. Has anyone else recieved threats of attacks?
    By ImLagging in forum Running a Web Hosting Business
    Replies: 17
    Last Post: 05-29-2004, 03:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts