Resetting the password for a user if we don't know changed password

May 7, 2024, 11:54

kulaggin

How can we reset the password or create new user on RPi and switch to it? I'm trying to help someone with their RPi issue, they got a ready project from someone else. They have custom user prototype and the password to this user is unknown. I'm trying to set up VNC connection on LAN network from their laptop to their RPi but we don't have the password for the user. Is there an easier way to solve this? Like creating a new user from the existing user and logging in using the new user? Or are we going to have to reinstall the whole system if they won't be able to contact the previous owner and get the password?

kulaggin

A minute later: they got the password from the previous owner. But I'm still interested: is there a way out of this without reinstalling the system?

thunder07337

riothedev

do u have root access?

riothedev

if so u can both create another uzer for it and reset the password

kulaggin

sudo commands work, yes

riothedev

then do sudo su

riothedev

and after that

riothedev

do passwd prototype

kulaggin

What will sudo su do? Substitute user google says?

kulaggin

But it says it'll ask me for a password?

riothedev

u can just do su -

riothedev

it'll put u into a root environment

riothedev

after ure in root environment u can do passwd prototype and change the pass