Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: mauricio on February 10, 2024, 07:30:47 PM

Title: How to gain single user access due to a lost root password
Post by: mauricio on February 10, 2024, 07:30:47 PM
Hello

I've an SD card with Debian image on it (Bullseye).

I was developing on an A20, during last year.

I've forgotten the root password (also my common user password), so I can't do login.

I've tryed to login (through serial screen) in single user mode, after modifiying /boot/uEnv.txt, adding :

optargs=single
But login prompt is still asking me for a password:

Give root password for maintenance
(or press Control-D to continue):

If I press Control-D, I receive:

Reloading system manager configuration
Starting default target

And login prompt

Please, there is something I can do to gain access so I can reset password ?

Thanks
Title: Re: How to gain single user access due to a lost root password
Post by: LubOlimex on February 12, 2024, 09:19:56 AM
Aside from what Google says about "reset forgotten root and user password" -maybe try to access the board via SHH over the Ethernet, the username and password should still be the original ones user olimex and password olimex
Title: Re: How to gain single user access due to a lost root password
Post by: mauricio on February 15, 2024, 06:36:56 PM
Thank you LubOlimex

I did change root and olimex password at the begining, last year, both forgoten

I did search for "reset forgotten root and user password", but since there's no GRUB but U-Boot

I stopped autoboot hitting any key at begining. But here on I don't know how to proceed to add "single" to boot options

Also found you can pass boot parameters using uEnv.txt file

# optargs - Optional arguments passed to the kernel

so I add

optargs=single
This last one seems to be wrong

Any help on how to pass "single" to boot options, so no login requiered ?

Or any other method. Some where in time (probably other linux image) I remenber twiking some option some where to enable/disable login requirement when connected through
serial cable, maybe?

Thanks
Title: Re: How to gain single user access due to a lost root password
Post by: JohnS on February 15, 2024, 08:32:06 PM
Mount the SD card on another computer (laptop etc) and change the vital files involved in what you want e.g. edit /etc/passwd (& others) to make a root with no password.

John
Title: Re: How to gain single user access due to a lost root password
Post by: mauricio on February 27, 2024, 09:44:16 PM
Thank you JohnS

I've done as you said. Following this post https://unix.stackexchange.com/questions/76313/change-password-of-a-user-in-etc-shadow (https://unix.stackexchange.com/questions/76313/change-password-of-a-user-in-etc-shadow) I was able to login as root and reset all my passwords

Thanks !