[solved] Login fails with root : password but ssh access works

SYSTEM INFORMATION
OS type and version: Ubuntu Linux 20.04.3 LTS
Webmin version: 1.981
Virtualmin version: 6.17-3
Related products version: Usermin version 1.823

I just made a change to the username through the webmen settings…from root to my name…
Then I could never get in again.
I tried all the ways available in the forum, but to no avail.
Like:

or

or

I also created a new user through ssh and the same problem

The login page is working.
Other users are working.
Only root, I can’t get into it.

reinstall your system and log into it with root and create new user for your self and leave root alone. use root account only when needed.

Hello
What are the steps to reinstall?

Reinstalling is overkill.

You probably set the root password in the Webmin Users module instead of using the system password…now you have two root passwords (a system password and a different one for Webmin). Don’t do that if you don’t want to keep up with two passwords. Use system passwords.

You can unset the root password by editing /etc/webmin/miniserv.users and changing the password for root from whatever it is (it’ll be a hash) to x. Restart the webmin service with systemctl restart webmin

Oh, wait. What the heck. I just read you renamed root? Why on earth?

So…the answer is login with your other username, right? (But, also, nobody do this. It doesn’t even make sense. Use either root or your default admin user, e.g. the first user account you created on Ubuntu, for Webmin.)

You can also create a normal system user with sudo ALL=(ALL) ALL privileges, and it will be able to login to Webmin with root level access.

If you just renamed Webmin user (using Webmin Users module), it means there would be no correspondent UNIX user, that could be used with default authentication method, which is set to Unix authentication by default (for default root user) and which you most likely didn’t change to Webmin password authentication by selecting Set to… from the drop down menu:


Either way the simplest solution to your problem would be using a new webmin passwd command to change the password and set Webmin password authentication automatically:

Example:

webmin passwd --user username

Well I was just trying to make the root more secure (that’s my guess)… Thank you
I searched the forum for ways to protect my server and try to implement it

Yes, that’s right, that’s what I did, and I didn’t put a special password here, so the problem appeared…

Anyway, the problem was fixed by the command webmin passwd --user root

thank you so much :heart_eyes:

Now you have two passwords (the system root password and the Webmin root password). I don’t really recommend this solution, either. But, I guess if you’re happy, I’m happy.

I will be happy if I stick to the recommendations for more security for my servers…
Well…can you make a suggestion on how to protect it more.

I personally always create a normal user with sudo access and don’t allow root to login at all, not in virtualmin, ssh, ftp whatever

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.