Skip to content

Deleting nouser Files – cleanup after cPanel

by admin on June 13th, 2009

Not many CPANEL server admin knows that when they delete user account, there are some of those user files that still left on the server. Because user has been deleted, so the files will be owned by nouser.

This can be a problem when your server is highly cycled (you add and delete users very frequently) because you can hit the system user limit. This means you cant create no more user on your system. Deleting user to add another one wont work.

Solution :

You have to remove all files that owned by no user. Usualy they placed on these directories :

  • /home
  • /usr/local/apache/conf/sites
  • /usr/local/frontpage
  • /usr/local/apache/domlogs
  • /var/cpanel/bandwidth
  • /etc/vdomainaliases
  • /var/cpanel/users.cache/
  • /var/cpanel/bwusagecache/
  • /var/spool/cron.suspended/

To find these files is quite easy. Just lunch :

find /usr/local/apache/conf/sites/ \( -nouser -or -nogroup \) -exec rm -f {} \;

find /usr/local/frontpage/ \( -nouser -or -nogroup \) -exec rm -f {} \;

find /usr/local/apache/domlogs/ \( -nouser -or -nogroup \) -exec rm -f {} \;

find /var/cpanel/bandwidth/ \( -nouser -or -nogroup \) -exec rm -f {} \;

find /etc/vdomainaliases/ \( -nouser -or -nogroup \) -exec rm -f {} \;

find /var/cpanel/bwusagecache/ \( -nouser -or -nogroup \) -exec rm -f {} \;

find /var/cpanel/users.cache/ \( -nouser -or -nogroup \) -exec rm -f {} \;

find /var/cpanel/bandwidth.cache/ \( -nouser -or -nogroup \) -exec rm -f {} \;

Note :

-exec rm -f {} \; meaning you execute rm -f to those files. You may change it for example : -exec chown root:root {} \;

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS