API tokens are unique identifiers used to grant applications or scripts access to cPanel services without needing a username and password. However, sometimes creating API tokens for reseller accounts on cPanel servers can lead to errors. Here, we’ll explain the common causes of these errors and how to fix them.
Common Errors and Fixes
1. Error: “The system failed to create the API token: Invalid or unauthorized ACL specified: frontpage”
This happens because an invalid ‘frontpage’ ACL is present in the file /var/cpanel/resellers
for a user (e.g., user1
).
Steps to Fix:
-
Backup the File:
Create a backup of the
/var/cpanel/resellers
file:bashcp -v /var/cpanel/resellers{,.backup.9558369}
-
Remove the Invalid ACL:
Run this command to remove the invalid
frontpage
ACL for the specific user:bashsed -i 's/frontpage,//g' /var/cpanel/resellers
-
Restart cPanel:
Save the file and restart cPanel. This should resolve the issue.
-
Fix for Multiple Users:
To remove the
frontpage
ACL for all users, run this command:bashsed -i.bak 's/frontpage,//g' /var/cpanel/resellers
After fixing, your /var/cpanel/resellers
file should look like this (example):
User1:acct-summary,add-pkg,allow-addoncreate,allow-parkedcreate,allow-unlimited-bw-pkgs,allow-unlimited-disk-pkgs,allow-unlimited-pkgs,basic-system-info,basic-whm-functions,cors-proxy-get,cpanel-api,cpanel-integration,create-acct,create-dns,create-user-session,digest-auth,edit-account,edit-dns,edit-mx,edit-pkg,generate-email-config,kill-acct,kill-dns,limit-bandwidth,list-accts,list-pkgs,mailcheck,manage-api-tokens,manage-dns-records,manage-oidc,manage-styles,mysql-info,news,ns-config,park-dns,passwd,public-contact,quota,show-bandwidth,ssl,ssl-gencrt,ssl-info,stats,status,suspend-acct,track-email,upgrade-account
2. Error: “The system failed to create the API token: Invalid or unauthorized ACLs specified: disallow-shell and frontpage”
This error occurs because the ‘disallow-shell’ setting is outdated and no longer supported in newer versions of cPanel.
Steps to Fix:
-
Add Missing Reseller Options for All Users:
Run the following script to update reseller settings globally:
bash/scripts/fix_reseller_acls --fix-disallow-shell --all-resellers --all-acl-lists
-
Fix for a Single User:
To update settings for one reseller (e.g.,
user1
), use this command:bash/usr/local/cpanel/scripts/fix_reseller_acls --add-default-privs --reseller user1
These steps will update the necessary permissions and allow API tokens to be created successfully.
Conclusion
Unable to Create API Tokens for Reseller Accounts" error in cPanel can be resolved by addressing specific issues with ACL settings. By identifying and removing invalid or unauthorized ACLs, such as 'frontpage' and 'disallow-shell,' and updating reseller settings, you can successfully create API tokens. Following the provided steps ensures that your cPanel system functions smoothly and securely. If problems persist, seeking help from experts is always a good option to ensure the issue is fully resolved.
iDatam Recommended Tutorials
Linux
Solving the 5 Most Common Linux Server Problems
Master the art of Linux server problem solving with this comprehensive guide. Learn how to diagnose and fix common server issues including network problems, disk space management, security vulnerabilities, and performance bottlenecks.
Mysql
How To Create a New User and Grant Permissions in MySQL
Learn how to create a new MySQL user and grant permissions with this comprehensive guide. Understand the essential commands, best practices, and troubleshooting tips for effective user and permission management in MySQL.
Control Panel, Security
Plesk Server Security Tutorial: A Step-by-Step Guide to Secure Your Web Infrastructure
Secure your Plesk server with our in-depth tutorial! Learn step-by-step techniques, from updates and advanced configurations to code-level protections and emergency strategies, to fortify your web infrastructure against potential threats.
Discover iDatam Dedicated Server Locations
iDatam servers are available around the world, providing diverse options for hosting websites. Each region offers unique advantages, making it easier to choose a location that best suits your specific hosting needs.