Go Back   Web Hosting Forums > Webhosting Forums > Dedicated Servers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Dedicated Servers Dedicated hosting, running your own webserver, and managed server discussions.

Reply
 
Thread Tools
  #1 (permalink)  
Old 18-04-2006, 11:53 AM
TWD_Tony's Avatar
Super Moderator
 
Join Date: Mar 2006
Location: Manchester, UK
Posts: 230
Default Beginners Guide to securing cPanel

This tutorial is by no means a how-to on how to completely secure a server running cPanel & Linux - it only covers the basics...

First Steps.

Change the following default settings in WHM...

Goto Server Setup > Tweak Settings

Under Domains

Prevent users from parking/adding on common internet domains. (ie hotmail.com, aol.com)

Under Mail

Attempt to prevent pop3 connection floods

Default catch-all/default address behavior for new accounts - blackhole

Under System

Use jailshell as the default shell for all new accounts and modified accounts


Goto Server Setup > Tweak Security

Enable php open_basedir Protection

Enable mod_userdir Protection

Disable Compilers for unprivileged users.


Goto Server Setup > Manage Wheel Group Users

Remove all users except for root and your main account from the wheel group.


Goto Server Setup > Shell Fork Bomb Protection

Enable Shell Fork Bomb/Memory Protection


Goto Service Configuration > FTP Configuration

Disable Anonymous FTP


Goto Account Functions > Manage Shell Access

Disable Shell Access for all users (except yourself)


Goto Mysql > MySQL Root Password

Change root password for MySQL

The next steps presume that you have root access and SSH access...

Firstly you need to log into your server via SSH, a good windows client for this is PUTTY (which you can download from here http://www.chiark.greenend.org.uk/~s.../download.html )
Once you have followed the PUTTY instructions and logged into your server:

At command prompt type: pico .bash_profile
Scroll down to the end of the file and add the following line:

echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | awk '{print $6}'`" your@email.com

Save and exit.

make sure you change the your@email.com to your email address (not a server email address) this will then automatically email you should someone log into your server as root via SSH.
__________________
Contact me for a great deal on UK or USA based hosting, multi-domain hosting and fully managed dedicated servers.
Reply With Quote
  #2 (permalink)  
Old 18-04-2006, 12:01 PM
WebHost Admin's Avatar
Administrator
 
Join Date: Mar 2006
Posts: 208
Default Re: Beginners Guide to securing cPanel

This looks great - I presume we're in WHM for this?
Reply With Quote
  #3 (permalink)  
Old 18-04-2006, 02:21 PM
TWD_Tony's Avatar
Super Moderator
 
Join Date: Mar 2006
Location: Manchester, UK
Posts: 230
Default Re: Beginners Guide to securing cPanel

I thought the 4th line gave it away...
__________________
Contact me for a great deal on UK or USA based hosting, multi-domain hosting and fully managed dedicated servers.
Reply With Quote
  #4 (permalink)  
Old 18-04-2006, 07:47 PM
WebHost Admin's Avatar
Administrator
 
Join Date: Mar 2006
Posts: 208
Default Re: Beginners Guide to securing cPanel

Just checking.
Reply With Quote
  #5 (permalink)  
Old 30-05-2006, 10:36 PM
triumph's Avatar
Senior Member
 
Join Date: May 2006
Posts: 123
Default Re: Beginners Guide to securing cPanel

I did not even know I could change all that stuff in WHM. I will definately be using this guide and go over my settings here on my reseller account. Thanks for the information!
Reply With Quote
  #6 (permalink)  
Old 30-05-2006, 11:25 PM
Junior Member
 
Join Date: May 2006
Posts: 25
Default Re: Beginners Guide to securing cPanel

Cheers man! I didn't know that! No body access my cpanel for 10 minutes while I do this....anything else we should know for securing Cpanel? There's always a way past and always a way to make somethign more secure.
Reply With Quote
  #7 (permalink)  
Old 31-05-2006, 04:31 PM
TWD_Tony's Avatar
Super Moderator
 
Join Date: Mar 2006
Location: Manchester, UK
Posts: 230
Default Re: Beginners Guide to securing cPanel

Quote:
Originally Posted by W.Harbaugh
Cheers man! I didn't know that! No body access my cpanel for 10 minutes while I do this....anything else we should know for securing Cpanel? There's always a way past and always a way to make somethign more secure.
Yes there are a lot more ways to secure a Linux / cPanel server, installing a firewall (from simple iptables to something more robust like APF) then you can install something like BFD (Brute Force Detection). There are some other apps you may want to install too - Chkrootkit and RootkitHunter will detect rootkits (a sort of Trojan) that can be used to compromise a server.
__________________
Contact me for a great deal on UK or USA based hosting, multi-domain hosting and fully managed dedicated servers.
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


All times are GMT +1. The time now is 10:10 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.