cPanel Scripts Failing? HTTP Basic Auth Is Off in v138
cPanel 138 refuses HTTP Basic auth on ports 2082 and 2083 by default. Find the scripts still sending passwords and move each one to an API token.
The short answer
If your server runs cPanel & WHM 138, scripts that log in to the cPanel interface (ports 2082 and 2083) with a username and password can fail, because the 138.0.1 release (24 August 2026) stopped accepting HTTP Basic authentication there by default. The documented fix is to create a cPanel API token for each script and send it in the header Authorization: cpanel username:TOKEN. WHM, Webmail and Web Disk are not affected by this change. Shared hosting customers cannot change the server setting, so tokens are their path.

Reading options
On this page
- What actually changed, in plain words
- Before you start
- Find the scripts that still send a password
- Create an API token in cPanel
- Switch the script to the token
- How to check it worked
- Clean up old and leaked tokens
- When the server admin has to act
- Troubleshooting
- The one message worth forwarding
- Reader questions
- Sources & further reading
Before you start
Account-owner cPanel access, access to each affected script and cron job, a private Bash session, a password manager, and a rollback copy stored outside public_html with mode 600. Never paste a token into chat, tickets or recorded sessions.
If a script that logs in to cPanel with a username and password has started failing, and the password has not changed, the most likely reason is a new default in cPanel & WHM 138. HTTP Basic authentication is now refused on the cPanel interface, so the fix is to switch that script to an API token. It is a small job per script once you know where to look.
Picture a nightly backup job that has run quietly for years. One morning the log shows a failed login, and nobody touched the server. The whole story sits in one line of the cPanel 138.0.1 changelog, dated 24 August 2026: "HTTP Basic authentication is no longer accepted on the cPanel interface (ports 2082 and 2083) by default."
By the end of this guide you will be able to find every script that still sends a password, move each one to an API token, test the token with curl, clean up old tokens, and know exactly when you need your server admin to step in.
What actually changed, in plain words
HTTP Basic authentication means the script sends your username and password with every request, packed into a header called Authorization: Basic. It is simple, which is why so many old cron jobs and backup scripts use it.
An API token is a long random string that cPanel creates for you. Your script sends the token instead of the password. Think of it like a hotel key card versus your house key. If the key card leaks, the front desk cancels that one card and you get a new one, and nobody ever had your house key.
The same 138.0.1 entry says to "Use an API token for scripted calls", or to re-enable a WHM Tweak Settings option named "Allow HTTP Basic authentication to the cPanel interface". In cpanel.config the setting is the reverse boolean skiphttpauth: skiphttpauth=0 accepts Basic authentication and skiphttpauth=1 refuses it. The entry also says "WHM, Webmail and Web Disk are unaffected."
Why this matters: if your script talks to WHM on port 2087 or to Webmail on port 2096, this change does not explain your failure.
At the time of writing (29 November 2026), the latest build on the official 138 changelog is 138.0.29, dated 27 November 2026. If your server runs cPanel & WHM 138, assume the new default applies unless your server admin has changed it.
Before you start
- The cPanel username and login for the account the script uses. You must log in as the account owner, because the cPanel docs say "Team users cannot access this feature or manage API tokens."
- Access to wherever the script lives: SSH or a terminal inside cPanel, your own laptop, a CI server, or another server that calls cPanel remotely.
- A place to test. If possible, use a non-production cPanel account first, such as a staging account.
- A private copy of the working script before you edit it. If the old script contains a password, store the copy outside
public_htmlwith mode 600 and delete it after the token migration is verified. - A password manager to hold the new token.
- A little quiet time per script. Creating a token is a separate step from editing your site.
Quick tip: if you also want to stop typing passwords for SSH, our guide to SSH key login on cPanel hosting pairs well with this one. Keys for SSH, tokens for the API.
Find the scripts that still send a password
Most people have more of these than they think. Find them all before changing anything.
Step 1: List your cron jobs
Cron is the scheduler that runs commands at set times. This command prints every cron job for the user you are logged in as, so you can see which ones call curl or a script.
crontab -lYou should see one line per job. Write down every script path, for example /home/exampleuser/bin/backup.sh.
Step 2: Search your scripts for Basic auth patterns
Scripts send Basic auth in a few common shapes. With curl, the -u option means "Specify the username and password to use for server authentication." In code, you will often see the header Authorization: Basic built by hand. This command searches a folder for both patterns and for the cPanel port numbers.
grep -rniE "authorization: *basic|curl .*(-u|--user) |:2083|:2082" /home/exampleuser/bin /home/exampleuser/scriptsEach hit shows the file, the line number and the line. Change the folder paths to wherever your scripts live.
Step 3: Check scripts written in PHP or Python too
Older PHP tools often build the header with base64_encode. The official cPanel authentication guide shows exactly this style in its PHP example, sending "Authorization: Basic " . base64_encode($whmusername.":".$whmpassword). This command finds that pattern in PHP and Python files only.
grep -rniE --include='*.php' --include='*.py' "base64_encode|b64encode|authorization.*basic" /home/exampleuserHeads up: not every hit is a cPanel login, so look at the URL nearby. If it points at your server on port 2083 or 2082, it is on your list.
Step 4: Do not forget remote callers
Some scripts never live on the cPanel server at all: a backup box at home, a CI pipeline, a monitor on another VPS. Run the same grep there, and check your CI settings for saved passwords.
Deploy tasks that cPanel runs itself, like the ones in our guide to deploying from Git with .cpanel.yml, run inside the account and do not log in over port 2083. Only scripts that call the cPanel API over the network need a token.
Create an API token in cPanel
Give each script its own token, so you can cancel one without breaking the others.
Step 5: Open Manage API Tokens
Log in to cPanel as the account owner. Go to cPanel > Home > Security > Manage API Tokens, the path given in the official cPanel docs.
If you do not see that icon at all, the cPanel docs are clear: "If you do not see this feature, your system administrator has disabled it." On shared hosting, ask your host. On your own server, the admin enables it in WHM > Home > Packages > Feature Manager.
Step 6: Fill in the form
Click Create. In the API Token Name field, give the token a name that says which script uses it, such as nightly-backup or deploy-staging. The docs say a name "can only contain up to 50 characters", using letters, numbers, dashes and underscores.
Under Should the API Token Expire?, pick Specify an expiration date. The default is one year from today, and the token expires at 23:59:59 server time on that date. You could choose that it never expires, but a date forces you to review it, which is healthy.
Heads up: per the docs, "You cannot edit an API token expiration date after creation." If you pick the wrong date, you will have to create a new token and revoke the old one.
One token per script makes revocation and auditing easier, but it is not a granular permission boundary. cPanel labels these tokens Unrestricted and does not offer per-function scopes in this screen. A token can call the UAPI and cPanel API 2 functions that the account can access; cPanel API 1 is not supported. Treat every token like a password for that cPanel account.
Step 7: Copy the token right away
Click Create, then Copy. Paste it straight into your password manager. The docs warn: "You cannot access the token after you navigate away from the interface." Then click Yes, I Saved My Token.
If you lose it, revoke it and make another. A token is cheap.
Switch the script to the token
You replace the username and password with a different header. Everything else stays the same.
Step 8: Know the new header format
The official cPanel token guide shows this exact format. The header carries your cPanel username and the token, and the module and function go in the URL.
curl -H'Authorization: cpanel username:APITOKEN' 'https://example.com:2083/execute/Module/function?parameter=value'Notice the word cpanel where you used to see Basic, and the token in plain text after the colon. There is no base64 step.
Also note what tokens can and cannot run. The docs say: "API tokens run UAPI functions and cPanel API 2 functions, not cPanel API 1 functions." UAPI is the modern cPanel API, and its URLs contain /execute/. If your old script calls a cPanel API 1 function, a token will not save it, and the script needs rewriting with a UAPI function.
Step 9: Store the token in a private file
Never put the token in a public Git repo, a shared script, a forum post or a screenshot. Anyone holding it can act as your cPanel account until you revoke it.
A tidy way is to keep the header in a small curl config file that only you can read. The -K option tells curl to "Specify a text file to read curl arguments from." This command creates that file. Replace exampleuser and the placeholder with your real values.
umask 077
read -rsp "Paste the cPanel API token: " CPANEL_API_TOKEN; printf '\n'
printf '%s\n' \
'# cPanel API token for the nightly backup script' \
"header = \"Authorization: cpanel exampleuser:${CPANEL_API_TOKEN}\"" \
> "$HOME/.cpanel-token.curl"
unset CPANEL_API_TOKEN
chmod 600 "$HOME/.cpanel-token.curl"read -s keeps the token off the screen, and the shell builtin writes it without putting the secret in the command text. Run this in a private Bash session, not a shared terminal or recorded support session. Do not paste the token into chat, tickets or CI logs.
The chmod 600 part means the owner can read and write the file, and nobody else can read it at all. Keep this file outside public_html, so the web server never serves it.
Step 10: Edit the curl line in the script
Here is a made-up example with placeholder names. Imagine your old backup script had this line, with the password typed right into it.
curl -s -u 'exampleuser:OldPassword123' 'https://example.com:2083/execute/Module/function?parameter=value'The new line removes the -u part and points curl at the private config file instead. The rest of the command does not change.
curl -sS -K /home/exampleuser/.cpanel-token.curl 'https://example.com:2083/execute/Module/function?parameter=value'Keep your script's own /execute/Module/function URL exactly as it was. The Module/function?parameter=value part here is a stand-in for whatever call your script really makes. Once the token works, delete the old password from the script and from old copies.
Step 11: The PHP version
If your PHP tool builds the header by hand, swap the Basic header for the token header. This replacement reads the token from an environment variable instead of the file.
<?php
$cpUser = 'exampleuser';
$cpToken = getenv('CPANEL_API_TOKEN');
$url = 'https://example.com:2083/execute/Module/function?parameter=value';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: cpanel ' . $cpUser . ':' . $cpToken]);
$response = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo $code . PHP_EOL . $response . PHP_EOL;Set CPANEL_API_TOKEN wherever your environment keeps secrets, for example in your CI settings or in the cron line that starts the script. Do not commit it to the repo.
How to check it worked
Test by hand before you trust the nightly run, on a non-production account first if you have one.
Test 1: A safe read call with curl
Pick one call your script already makes that only reads information and changes nothing. This command runs it with your token and prints the HTTP status code at the end.
curl -sS -K /home/exampleuser/.cpanel-token.curl -w '\nHTTP %{http_code}\n' 'https://example.com:2083/execute/Module/function?parameter=value'Replace Module/function?parameter=value with your script's own call. The %{http_code} part prints "The numerical response code that was found in the last retrieved HTTP(S) or FTP(s) transfer." You want to see the same kind of JSON output your script expects. If you see an error instead, check the username, token and port.
Test 2: Run the real script once
Run your edited script by hand, the same way cron would.
bash /home/exampleuser/bin/backup.shThen check what the script should produce, such as a backup file with today's date. Only then leave it for cron.
Finally, run the search from Step 2 again. Any leftover hit for that script is a password still sitting in a file.
Clean up old and leaked tokens
Tokens pile up. Two facts from the official docs make cleanup worth a calendar reminder.
First, expired tokens stay around. The token guide says: "When an API token expires, the system does not remove it. You must manually delete an API token."
Second, a password change does not cancel tokens. The release notes for Meridian, an optional cPanel interface, describe a page shown when a password change is required, and say active API tokens "keep working after the change and should be replaced."
Step 12: Revoke tokens you no longer need
In cPanel > Home > Security > Manage API Tokens, find the token, click Manage, then Revoke, then Yes, Revoke the Token. To remove several at once, tick their checkboxes, click Revoke, then Revoke Selected API Tokens.
Developers can do the same from code with the UAPI function Tokens::revoke. For most people, the interface is quicker and safer.
Why this matters: if your host ever reports a breach, tokens are one more thing to rotate along with your passwords. Our checklist on rotating email, FTP and WordPress credentials after a host breach covers the rest of that list.
When the server admin has to act
On shared hosting
On shared hosting you cannot change WHM Tweak Settings or the cpanel.config file. Your documented path is the token. If Manage API Tokens is missing from your cPanel, the host has the feature switched off in Feature Manager, and only the host can turn it on. Ask them, and the message at the end of this guide does that for you.
On your own VPS or dedicated server
If you run WHM yourself, the clean fix is still to move scripts to tokens. The changelog does allow turning Basic auth back on, but here is the trade-off: Basic auth sends the real account password with every call, so any script, log or copied command line that leaks it hands over the whole account. A leaked token can be revoked on its own. The cPanel authentication guide also advises: "We recommend that you use a secure remote login when possible."
If you must re-enable it for a short time while you migrate, check your own WHM first. The official docs disagree about where this setting lives. The 138.0.1 changelog names a Tweak Settings option called "Allow HTTP Basic authentication to the cPanel interface". When I opened the Tweak Settings security page today, it did not list that option. The cpanel.config reference page lists skiphttpauth with a default of 1 and says "No Tweak Settings equivalent." The cpanel.config file sits at /var/cpanel/cpanel.config.
So do not rely on any single menu path from a blog post, this one included. Search Tweak Settings on your own server for "Basic", and read the current changelog before you change anything. Set a reminder to switch it back off once your scripts use tokens. And if you only ever use password logins over the secure port, the auth guide says to "Only use this method with a secure SSL connection over port 2083 (cPanel), port 2096 (Webmail), or port 2087 (WHM)."
Quick tip: while you are in WHM, confirm the server is fully updated. Our 10-minute patch check for cPanel and Plesk VPS servers walks through that.
Troubleshooting
The script fails but the password is correct
Symptom: the same username and password work in the browser, but the script's API call is now refused with an authentication failure. Likely cause: the script uses Basic auth on port 2083 or 2082, and your server runs cPanel & WHM 138 with the new default. Fix: switch the script to a token as shown above.
"Permission denied" or "Function not found"
Symptom: the token is fine but the call returns one of those messages. Likely cause: the wrong port. The cPanel auth guide warns that "Otherwise-correct calls will return Permission denied or Function not found errors if they use an incorrect port number." Fix: use 2083 for cPanel, 2087 for WHM, 2096 for Webmail.
The Manage API Tokens icon is missing
Symptom: you cannot find the feature under Security. Likely cause: you are logged in as a team user, or the host has disabled it. Fix: log in as the account owner. If it is still missing, ask your host to enable it in WHM Feature Manager.
The token works in curl but not in the old script
Symptom: the test in Test 1 passes, the real script still fails. Likely cause: the script calls a cPanel API 1 function, which tokens do not support, or it still sends the old -u option alongside the new header. Fix: remove every trace of the password, and if the call is a cPanel API 1 function, rewrite it with a UAPI function that does the same job.
A WHM script on port 2087 broke at the same time
Symptom: a script that talks to WHM also fails. Likely cause: something else, because the changelog says WHM is unaffected. Fix: debug that script separately.
A token you made months ago stopped working
Symptom: a script that worked with a token now fails. Likely cause: the token reached its expiry date, or someone revoked it. Fix: open Manage API Tokens and look for the token. Expired tokens stay listed because cPanel does not remove them. Create a new token, update the config file, then revoke the old one yourself.
The one message worth forwarding
Send this to your developer or host:
"Hi, our server may now run cPanel & WHM 138. The 138.0.1 changelog (24 August 2026) says HTTP Basic authentication is no longer accepted on the cPanel interface, ports 2082 and 2083, by default. Can you please check which of our scripts or tools still log in to cPanel with a username and password, and move each one to its own cPanel API token (header format: Authorization: cpanel username:TOKEN)? Please keep the tokens out of Git and shared files, give them expiry dates, and revoke any old tokens we no longer use. If the Manage API Tokens feature is not available on our account, please enable it in WHM Feature Manager. Thanks."
The short version: your password did not break, cPanel stopped accepting it from scripts, and a named token per script is the fix that also leaves you safer than before.
Reader questions
Did my cPanel password stop working?
No. Your password still works for logging in through the browser. cPanel & WHM 138 stopped accepting it from scripts that send it with HTTP Basic authentication to ports 2082 and 2083.
Are WHM API scripts on port 2087 affected?
Not by this change. The 138.0.1 changelog says WHM, Webmail and Web Disk are unaffected, so a failing WHM script has a different cause.
Can I limit a cPanel API token to one API function?
The Manage API Tokens screen labels tokens Unrestricted and does not provide per-function scopes. A token can call UAPI and cPanel API 2 functions available to that account; cPanel API 1 is unsupported. Use one token per script for revocation and auditing, but still treat it like an account password.
Does changing my cPanel password cancel my API tokens?
Not according to cPanel's Meridian release notes, which say that after a required password change active API tokens keep working and should be replaced. Revoke and recreate them if you suspect a leak.
Why can I not find Manage API Tokens in my cPanel?
Team users cannot use the feature, so log in as the account owner. If it is still missing, the server administrator has disabled it in WHM Feature Manager and must enable it.
Do expired API tokens delete themselves?
No. cPanel says the system does not remove an expired token, so you must revoke it yourself in Manage API Tokens or with the UAPI Tokens::revoke function.
Can I change a token's expiry date later?
No. cPanel's documentation says you cannot edit an API token expiration date after creation. Create a new token with the right date and revoke the old one.
Was this guide helpful?
Help us make the next update better.
Sources & further reading
What changed
Security correction: replaced an on-screen token placeholder with hidden input and a mode-600 config file, clarified that cPanel API tokens are unrestricted within the account APIs they support, and added original media and prerequisites. Slug and original publication date preserved.
Originally published . About our editorial updates.



