The officially official Devuan Forum!

You are not logged in.

#1 Today 18:01:57

Tweedlewise
Member
Registered: 2025-01-19
Posts: 21  

Forgot login/sudo password

For a couple of months, I have suspended my PC instead doing a complete shutdown when I wasn't going to be using it for a while.
(while ~= overnight to a couple of days)
So, the other day, I wasn't getting sudo to work (it was rejecting the password(s) I entered), so I rebooted thinking it just needed a refresh.
So, imagine my surprise when after it booted, I wasn't able to login to my account!  I've since tried many passwords and many attempts.
Feeling that all was lost, I was prepared to do a complete install of 5.0, until an acquaintance suggested booting with a LIve-CD.

I did and was able to copy my home directory to a "safe" disk.

I see that Devuan 6 is available.

How did I manage to forget my login/sudo pw?
I could blame it on the chemotherapy I'm undergoing (I have been in remission for over a year- thank you!)
as it does cause forgetfulness, or just that I'm getting old.

So, what advice can you offer me?
Is the PW gone, buh-bye, lost for good?

I've been thinking of doing a clean install after fumbling through my first attempt last year.
So, if the password is unrecoverable, I plan on installing 6.0, and let the Live-CD installer do most of the work.
(I think I need a complete scrub of the HDD anyway)

There are no other accounts on the PC.
What other directories/files should I also copy off the PC before reformatting?

Thank for any insight you can give me!

And before this, I was one of the guys who kept reminding others to make frequent backups...
Pass the crow, please...

Tweedlewise

Offline

#2 Today 18:18:28

Mercury
Member
Registered: 2024-11-14
Posts: 33  

Re: Forgot login/sudo password

Do you actually need to know the original password, or do you just want to reset it so the account is usable again? The latter is definitely possible, and a websearch should have given you an answer already. Here's the top result I got:
https://serverfault.com/questions/11218 … -on-debian

When it happened to me, I removed the password altogether by directly modifying /etc/passwd, so it's a valid alternative approach:
https://unix.stackexchange.com/a/533599

Last edited by Mercury (Today 18:20:52)

Online

#3 Today 18:23:36

Camtaf
Member
Registered: 2019-11-19
Posts: 536  

Re: Forgot login/sudo password

Yep, definitely back up your /home directory - then you can either attempt to regain access via single user/root account, or reinstall & replace your files to the new /home directory.

Offline

Board footer