AdminsForum

CyberPanel Getting Started Guides

Guide How to Reset the CyberPanel Admin Password From SSH (adminPass)

Started by JAY 0 replies 105 views
1JAY
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
#1
How to Reset the CyberPanel Admin Password From SSH (adminPass)

Forgot the CyberPanel admin password, or the login page keeps saying it's wrong? If you still have root SSH access, you can set a new one in a few seconds. Before you run the usual one-liner, though, look at what it does: it leaves your new password in a plain-text file.

The quick fix
Log in to the server as root (SSH, or your provider's VNC console) and run:
Code:
adminPass 'YourNewStrongPassword'
Use single quotes so characters like
Code:
$
or
Code:
!
aren't interpreted by the shell. Then log in at
Code:
https://YOUR-SERVER-IP:8090
with user admin and the new password.

What adminPass really does
We looked at what the command actually does on our server:
[Image: attachment.php?aid=547]

Code:
cat /usr/bin/adminPass
It's a three-line script:
  1. Runs
    Code:
    /usr/local/CyberCP/plogical/adminPass.py --password "..."
    , which sets the new password (hashed) for the admin user in CyberPanel's database.
  2. Restarts the panel:
    Code:
    systemctl restart lscpd
    .
  3. Writes the password to
    Code:
    /etc/cyberpanel/adminPass
    in plain text.
The file is only readable by root (
Code:
-rw-------
), but anyone who ever gets root access or a copy of your server backup can read it. In the same folder you'll also find
Code:
mysqlPassword
(the MariaDB root password) and
Code:
webadmin_passwd
(the OpenLiteSpeed WebAdmin password). Keep that folder out of any backups you send off-site unencrypted.

Clean up after resetting
Remove the plain-text copy and the password from your shell history:
Code:
shred -u /etc/cyberpanel/adminPass history -c && history -w
Or avoid the history entry in the first place: start the command with a space (works when
Code:
HISTCONTROL
includes ignorespace, the Ubuntu default), or read the password silently:
Code:
read -s -p "New admin password: " P; echo adminPass "$P"; unset P

Other things the same script can do
Code:
/usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/adminPass.py --help
Besides
Code:
--password
, it has
Code:
--api 1
/
Code:
--api 0
to switch the admin's API access on or off (it prints the API token when enabling). On our server the admin had
Code:
twoFA = 0
and
Code:
api = 0
:
Code:
mysql cyberpanel -e "select userName,twoFA,api from loginSystem_administrator"

Locked out by 2FA instead?
adminPass doesn't touch two-factor authentication. If you lost the phone with your authenticator app, switch 2FA off for the admin user from SSH, log in, and turn it on again with a new device:
Code:
mysql cyberpanel -e "update loginSystem_administrator set twoFA=0 where userName='admin'" systemctl restart lscpd
Turn 2FA back on right away: see first steps after install.

Still can't log in?
  • Server Error (500) instead of the login page: that's not a password problem. See our Server Error (500) fix.
  • Page doesn't load at all: port 8090 blocked, or lscpd stopped:
    Code:
    systemctl status lscpd
    . See checking CyberPanel services.
  • Reseller or normal user forgot their password: log in as admin and change it under Users & Plans. adminPass only resets the admin account.

More CyberPanel guides
Tested on CyberPanel 3.0 (build 8, OpenLiteSpeed edition) on Ubuntu 24.04, October 2026. Menu names can change slightly between versions.

Attached Files

Image(s)
   
Reply
Possibly Related Threads…matched by title
Replies:0Views:15
Replies:0Views:106
Replies:0Views:103
Replies:0Views:110
Replies:0Views:101

Users browsing this thread: 1 Guest(s)
Forum Jump: