This function restricts root login to cPanel & WHM based on a list of CIDR addresses.
Note:
This API manipulates /var/cpanel/authorized_whm_root_ips
. We HIGHLY recommend
you not modify this file directly. Improper formatting of the file can lead to loss of all
access to cPanel & WHM using the root password.
Use of this API replaces any previous restrictions so be sure to include previous CIDR patterns when adding new ones.
As this API only restricts logins, please be aware that existing root logins are not terminated when these restrictions are asserted.
This API DOES NOT restrict root resellers.
HTTP Request was successful.
object | |
object |
whmapi1 --output=jsonpretty \ restrict_whm_root_access \ cidr=10.2.0.0/16 \ cidr=10.6.5.0/24 \ cidr=10.1.6.7
{- "data": {
- "cidr": [
- "10.2.0.0/16",
- "10.6.5.0/24",
- "10.1.6.7"
]
}, - "metadata": {
- "command": "restrict_whm_root_access",
- "reason": "OK",
- "result": 1,
- "version": 1
}
}