Monday, December 1, 2014

10 WHM Command Line Tips and Tricks

Create an account:
/scripts/createacct <options>
Changing a Site’s IP Address
/usr/local/cpanel/bin/setsiteip [-u user | domain] ip
Remove, suspend, or unsuspend an account:
/scripts/killacct $user
/scripts/suspendacct $user “$reason”
/scripts/unsuspendacct $user
Change an account’s password:
/scripts/realchpass $user 'password'
Find out who owns a domain name:
/scripts/whoowns $user
grep $domain /etc/userdomains
View IP address usage:
/scripts/ipusage
cat /etc/domainips
Install an SPF Record or DomainKey:
/usr/local/cpanel/bin/spf_installer $user
/usr/local/cpanel/bin/domain_keys_installer $user
Run statistics:
/scripts/runweblogs $user (one user)
/scripts/runlogsnow (all users)
Change a MySQL password:
/scripts/mysqlpasswd $user '$password'
View user resource usage (WHM > Daily Process Log):
/usr/local/cpanel/bin/dcpumonview
As you may notice, most of the commonly-used commands are in two locations: /scripts and /usr/local/cpanel/bin . Take a look at the scripts in those folders and find which ones may be useful for your day-to-day tasks.

You can also check out cPanel’s listing of scripts, located at http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/WHMScripts .
Remember though – never run a script that you’re not familiar with, especially as root. Doing so could yield unexpected results or damage your system.

No comments:

Post a Comment