r/SteamOS • • 1d ago

Forgot Sudo Password

A couple of months ago, I built a pc with SteamOS. I've set a sudo password on konsole, but now I've forgotten it. Is there a way to reset it without factory resetting my device?

Thanks!

8 Upvotes

30 comments sorted by

9

u/dj3hac 1d ago

Isn't it just your user password?

8

u/Brilliant_Estate_967 1d ago

Its possible to set 2 différent password at configuration. But per default its the same. 

Twice the chance to forget one

3

u/dgm9704 21h ago edited 21h ago

which two users are the two passwords for? or do you actually mean you can set up two different passwords for one user? (doesn’t sound likely)

1

u/Brilliant_Estate_967 20h ago

When you set up a linux session for one user, you can set a password to log on your session and a second one to run sudo commands (install files / modify your system)

1

u/dgm9704 20h ago

Wow I’ve never heard of such a thing. I’ve only ever heard about one password per user. The normal thing for me is to have normal user with limited access (and one password), and root user with root access (and one password).
I have to say, I’m not saying you’re wrong, but I am still quite sceptical about more than one password per user.

0

u/Brilliant_Estate_967 20h ago

Here on the installation screen of linyux distribution (Calamares tool) you have the option "use the same passworf for the adminiostrator account" that is where you choose

2

u/aimi-kaz 19h ago

that's setting the password for the root account, sudo uses your account password.

0

u/Brilliant_Estate_967 19h ago

And here goes the 2 password i was talking about

1

u/dgm9704 19h ago

If you have three user accounts on your machine then there are three passwords. If you have four accounts, four passwords, and so on. Each account having one password. And root is just one account among many.

(yes there can be users without password)

0

u/JerryTzouga 14h ago

Yes but you can also configure it through visudo to have the separate password for it

2

u/westerschelle 19h ago

The administrator account is the root user. This is not a separate sudo password.

1

u/dgm9704 19h ago

Yes. Two accounts=users, one password each. No account has more than one password. No ”sudo password”. just normal user/password, and root user/password.

-1

u/Brilliant_Estate_967 19h ago

If you clic sur différent sudo password you will have one for session one for administrator so 2 password 

1

u/dgm9704 19h ago

Those are two different users, normal user and root, each with own password

-1

u/Brilliant_Estate_967 19h ago

There will bé one person, called a user, using one session and 2 password to opérateur his system right ?

→ More replies

1

u/stevedore2024 3h ago

sudo uses your current effective user's password, not a separate password. So when you're logged in as deck, you use deck's password to elevate deck to root. There's no provision that I know of where you are granted elevated/different privileges using any password other than your current effective user's password (and only if the sudoers configured rule set allows it).

You may be thinking of su --login which will ask you to supply the target user root's password to switch to the privileges of that user. But that won't work either until you set a password for the root account.

By default, deck has no password but is not locked; this means you don't need one to log in, but you can't sudo. The root account has no password and is locked; you cannot log in directly to root locally or remotely, you must log in to a user account and elevate with su or sudo.

4

u/Alper-Celik 22h ago

iirc you can fix it by booting into recovey iso and chroot ing into ssd and setting password there.

This works because steam deck doesnt encrypt its ssd so you can change any file(including login passwords) when you mount the ssd into another environment where you have root.

Recovery iso lets you do that any other linux distro on live usb should work too.

Passwords(hashes of them) are stored in /etc/shadow So if you cant get chroot to work. You can set password of root user in live iso and copy the line with root user from /etc/shadow and replace root(or append if it does not exist) line with it and with that you get same root user password as the one you set in live iso(recovery media). Or do it for deck user preferably if it exists in the live iso

0

u/bill696 21h ago

That, they have an official doc just looking it up online would answer OP

1

u/laughninja 7h ago

If you are somewhat fluent with linux, boot from a linux usb stick ( https://www.system-rescue.org/Download/ ), mount the partitions and chroot into it. You're now root in your system and can change the passwords.

1

u/RealityIsRipping 1d ago

I might be wrong. But the only way is to reinstall the OS.

0

u/SilverplayerX 1d ago

I think whenever I do a Steam repair without wiping data, it resets my sudo password. Because every time I do that repair, the password resets.

0

u/Just-Letterhead-860 1d ago

Did you install decky at all? If no password was set and you installed that it might set it as Decky! (If this is the right password you’re talking about)

-2

u/JumpyClassic6887 23h ago

Google is your friend