Artix Linux Forum

Artix Linux => Package management => Topic started by: bog2 on 10 December 2020, 02:56:09

Title: cant log in but im using the right password
Post by: bog2 on 10 December 2020, 02:56:09
Hello, I've been using the same password for a couple of months now. Yesterday, I went to sudo pacman -Syu but when I used my password, it simply said "Incorrect password. try again" I logged out of Artix and now I cant log back in. Currently writing this in a different distro. Is there anything I can do?

Thank you.

also, sorry if this is in the wrong subforum. im new.
Title: Re: cant log in but im using the right password
Post by: ####### on 10 December 2020, 04:27:41
Brute force unencrypt the password with john the ripper? You might want to use cgmanager or something similar for cpu limiting though or it will use 100% CPU possibly for hours (days? who knows...!) on end. This would look randomly / incrementally, which might be what you wanted, although you can do smart searches, and might want to modify this command:

Code: [Select]
/path-to/run/john --session=s1 --save-memory=1 --min-length=?(somenumber) --max-length=? --incremental=ASCII ~/path-to-passwd-copy/passwd
(restart cracking after reboot, you could automate this as a startup command so it runs whenever you are running)
/path-to/run/john --restore=s1
(show results)
/path-to/run/john --show ~/path-to-passwd-copy/passwd
Some probably quicker approaches: there are usually backup files too for /etc/passwd and /etc/shadow called /etc/passwd~ and /etc/shadow~ and I THINK you can copy the original ones aside and copy the backup *~ ones in, after mounting the partition from elsewhere, but I have never done this myself! Probably there are ways to clear or reset the password if you mount the drive as root and could chroot to it or something - I seem to remember setting passwords in a chroot before, and you gain root permission in the system you are chrooting from, not to.
And you have to wonder what has changed so you can't log in - has the password changed? Or is this some kind of keyboard issue so you aren't typing what you think you are - a fault, keymap change etc.? And is there anything in .bash_history (or equivalent) and /var/log/pacman.log that would suggest something was changed in that session? A permissions issue might cause this kind of thing. You should be able to regain access somehow, although it could be tricky if you encrypted your hard drive. Whatever path you decide on you should probably try and find some more details online than what I've said here, which are just some ideas to explore.
Title: Re: cant log in but im using the right password
Post by: phoenix_king_rus on 10 December 2020, 11:44:27
How about chroot from other distro/live image and run passwd?
Title: Re: cant log in but im using the right password
Post by: nous on 10 December 2020, 21:02:51
What @phoenix_king_rus  said is the most simple and straightforward way. Also, have a look at this pam-related bug report (https://bugs.archlinux.org/task/67636).