Resetting root / admin password

SYSTEM INFORMATION
OS type and version Rocky 9 .8
Webmin version 2.651
Virtualmin version 8.1.0. pro
Webserver version ??

I have ssh key access to the command line on the my server, but am unable to login with admin or root via port 10000. How can I reset the admin/root passwords from the command line?

Cheers Brian

Hello,

This can be done using webmin passwd command.

Thanks. Worked fine.

If you’re using system users, as you should be in a Virtualmin system, you should use the system passwd command and not create a separate user password just for Webmin.

At least, I don’t think webmin passwd resets system passwords.

Webmin can have an independent password for your users, but you generally shouldn’t, because one day you’re doing to be confused when you can log in to ssh and not Webmin or vice verse when using the same password…it’s because you split the passwords by setting a new Webmin password instead of sticking with the system password.

We should probably make webmin passwd warn about that duality.

Thanks, Joe, very good points!

Yeah, you’re right. I patched webmin passwd command to communicate that more clearly, e.g.:

root@alma10-pro:/etc# webmin passwd root
Warning: Webmin user root is also a Unix user. A separate Webmin password overrides Unix authentication, so Webmin and SSH can have different passwords.
  1. Change the Unix password and use Unix authentication in Webmin (recommended)
  2. Set a separate Webmin-only password in miniserv.users
Select password type [1]: 1
New password: 
Retype new password: 
passwd: password updated successfully