Both root and generic user passwords stopped working
antiX / MX LinuxThis forum is for the discussion of antiX and MX Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Both root and generic user passwords stopped working
Hi everyone,
I ran into a real strange problem with my access passwords today. It all started after I installed MX Linux from scratch with a previously created live usb. The live usb has been used for the installation on about a dozen machines, so I'm relatively certain that the live USB is/was fine. Installation went without a hitch, as did a couple reboots afterwards.
However, the root password from the installation was a default password that I wanted to replace with one of my own. So I opened up the MX User Manager, entered the original password in order to be able to work with the user manager, and then proceeded to change the the login password to my desired choice. All of this worked without a problem whatsoever.
A couple of hours later I paid for and downloaded the file to a very reputable VPN provider. I downloaded their .deb file without a problem. Then I clicked on the .deb in order to install it. And that's where everything went sideways (but it has nothing to do with the .deb file).
I was prompted for a password in order to install the .deb file. For some odd reason the newly "successfully" changed password did not work. Three tries and I was bumped out. Then I tried it again by using the original old login password. Same thing, three tries and I was bumped out. Okay, no problem, let me get back into the MX User Manager in order to try and figure out where the password issue is, or to simply assign a new password.
Uh oh, the user manager didn't accept either of those two passwords either.
What the heck? Then tried sudo apt-get update ... same issue with both passwords.
At this point I'm totally stumped and have no idea what's going on? I'm afraid to reboot my machine, just in case the same thing happens on the login screen after rebooting. Everything on my system works and I haven't come across any errors for anything .... except this strange inexplicable password issue. Can someone please help me to get this resolved with the terminal? If at all possible I'd just like to set root privileges for myself across the board. Nobody else touches this machine, so that shouldn't be an issue.
I'm simply not able to use any passwords at the moment ... ???
Thank you.
One way to break out of this kind of situation is to boot from a rescue disc, mount your usual root partition and manually edit the shadow file where the passwords are actually stored (/etc/shadow). You will need to change its permissions; by default it is not writable even by root. Once you have backspaced out the root password and reset the file permissions, you should be able to reboot and log in as root without any password at all. Then you can reset your password.
Then I clicked on the .deb in order to install it. And that's where everything went sideways (but it has nothing to do with the .deb file).
How do you know that? It appears that the file could have been infected with something
Quote:
One way to break out of this kind of situation is to boot from a rescue disc, mount your usual root partition and manually edit the shadow file where the passwords are actually stored (/etc/shadow).
Instead of manually editing the files, I recommend that you do the following instead:
* Boot the system from a rescue disk
* Open a command prompt, mount the root partition of the installation (all commands here are run as root)
Code:
mount /dev/sdx1 /mnt/location
Where /dev/sdx1 is your installation's root partition, and /mnt/location is the directory where you are mounting it.
* Once mounted chroot to the installation using the following command:
Code:
chroot /mnt/location
Once done, you can issue a passwd command to reset the password. Once the password is changed, type exit to exit from the chroot env and then you can reboot the system and boot into your linux install to log in with the new password
Once done, you can issue a passwd command to reset the password. Once the password is changed, type exit to exit from the chroot env and then you can reboot the system and boot into your linux install to log in with the new password
I wonder if that would work in this case. passwd requires the existing password to be given before setting a new one. If the existing one doesn't work for some reason, you're no better off. But it's less drastic than my method and certainly worth trying first.
Thank you Hazel and suramya.
I'll try and get it resolved with Hazel's suggestion. That seems to be the easier way to go or at least something that I can relate to easier.
I know that the image is good for two reasons. One, because it's an image that I created on another one of my machines with a problem that has occurred strictly on this and none of the other machines, and Two, because the issue didn't exist at all, until I decided to use the MX User Manager. Before then everything was fine and the passwords were working correctly, both old and new, depending on which application I was using (either from my old previous apps or the new app with the new password from the image.
There was another problem with the MX User Manager too, perhaps it has something to do with it?
I created myself a new user with the new password. Then I logged off, followed by logging in with the new user and then deleting the other default user from the MX User Manager. But the user didn't delete because after a reboot when I tried to use something from the old user which had been deleted by the new user with the proper credentials ... I received an error message that the function couldn't be completed because it was still being used by another user. The only other user which existed though, was the one that I had deleted. So I think this whole issue has something to do with the MX User Manager not "managing" the desired functions properly.
I took a look at the MX User Manager and it's precisely the kind of software that I detest. It takes something that used to be simple (in the sense of not being internally complicated or hard to understand) and deliberately complicates it in the interests of "user-friendliness". It's not so friendly when it goes wrong, is it!
I'm not sure about the version of MX since I just keep doing updates, including kernel updates when they come along. Then about every 4 months I check for an upgrade i.e. sudo apt-get dist-upgrade followed by another general update. So I've been creating updated images of my setup for the past 2.5 to 3 years and never had a problem until now.
If someone could just provide me with a step by step for creating a brand new user account with a password via the terminal ... or even without a password ... then I can just redo everything with the new account and ignore the user with the password issues. I believe the password issues that I've been experiencing are limited strictly to the operation of the MX User Manager. So with a new account, I would make it a point to never use the MX User Manager again.
Problem solved?
To create a new user, you have to be root. If you can log in as root, fine. I'd advise using ctrl+alt+F2 to get a text console to log into rather than logging in graphically. You should never log in graphically as root and some desktops won't let you anyway. If you can't log in as root at a text console, use the chroot method described by suramnya.
Once you are in as root, use the adduser command, with the new user's name as argument. I think all Debian-based distros have this command; it's a bit easier to use than the original useradd. Then use the passwd command with the user's name to set a password. That should be all you need.
I wonder if that would work in this case. passwd requires the existing password to be given before setting a new one. If the existing one doesn't work for some reason, you're no better off. But it's less drastic than my method and certainly worth trying first.
Actually no, since you are logged in as root and have used chroot. It is a bit counter intuitive but all the guides to resetting passwords suggest this method.
At one time especially with Ubuntu with only an administrator user i.e the user created during the install, if that user was deleted regardless if the new user had sudo privileges it could not do anything with sudo. I am wondering if MX is similar.
I just installed MX 21 and the installer "asks" if you want to create a root password. I've played with other versions but I don't remember if the installer is the same. I don't know of a default root password except for the live version.
A slightly easier (maybe) way to change the root password is to boot to recovery mode. At the grub boot menu press e, then add init=/bin/bash to the end of the line that starts with linux. Leave a space between splash and init. After it boots, your in single user mode as root, use the passwd command to change root's password. To reboot the system after the password change type in exec /sbin/init at the prompt.
Thank you everyone.
I'm not as comfortable with these solutions as I thought I would be. The terminal is something that I use rarely, strictly for updates, generic occasional sh package installations, and other "boring simple" tasks. Although it may be considerably more time consuming, another installation from scratch is something that I would be more comfortable with, due to the familiarity of the process. I may have gotten away from Windoze back in 2009, but I'm definitely 99% still a "point 'n' click" junkie.
I'm going to restore my grub with the boot repair iso and then wipe out the installation/user with the password issues from the fresh install completely. Afterwards I'll install the live usb again, but this time I'll take the default user and leave that one as is. Again, thank you. All of your answers are appreciated.
If you're not accustomed to the command line, it's a tall order to be told to suddenly start using it in an emergency. Of course you should do what you feel most comfortable with. But maybe when you are up and running again, you might want to start exploring that interface, just to learn a bit about it. One thing about Linux is that when it goes wrong, you can nearly always fix it, but not necessarily with graphical tools alone. Having access to the command line gives you a bigger toolbox.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.