Sunday, 30 December 2012

cPanel command-line:

cPanel:

To assign file owerships for webusers:

# /scripts/chownpublichtmls


To assign mail permission:

# /scripts/mailperm or WHM >> Email >> Repair Mailbox permissions.

Limit webuser resources (cpu / memory / etc):

# vi /etc/security/limits.conf


Set all files / directory recursively to secure permissions. Only in users "pwd"

# find . -type d -exec chmod 755 {} \;
# find . -type f -exec chmod 644 {} \;


Set files / directory secure permissions rest of proper. Only in users "pwd"

# find . -type f -not -perm 644 -exec chmod 644 {} \;
# find . -type d -not -perm 755 -exec chmod 755 {} \;


(suspect spam)To check maillog with sending path details.

# grep "cwd=" /var/log/exim_mainlog|awk '{for(i=1;i<=10;i++){print $i}}'|sort|uniq -c|grep cwd|sort -n


cPanel & Linux EL:

Change default linux editor (I selected VI):

# VISUAL=vi;export VISUAL;EDITOR=vi;export EDITOR;

(suspect attack)TO check current /  connection on port:80

# netstat -an | grep :80 | grep EST | awk '{ print $5 }' | awk -F: '{ print $1 }' | sort | uniq -c | sort -nk 1

No comments:

Post a Comment