Jump to content

How can I change my forgotten password using a terminal command line command (desktop/debian/buster/10)?


Recommended Posts

Posted

If i can not change the forgotten password, how can I copy over a new debian OS download to a microsd card without the password? 

 

I used to use something like "sudo cp name.OS dev/xx/xx". I haven't used debian in almost a year and forgot most commands, at least partially.

 

I always use the command line in a terminal . 

 

Thanks!!

Posted

If you can pop an SD card out and access it, easiest is to edit kernel command line via /etc/armbianEnv.txt and add "systemd.debug-shell=1", which adds a root level shell the next time you boot that you can use to reset your password over vga/keyboard. Think it's on tty12 (ctl-alt-F12) if memory serves? Might have to check.

 

Another alternative if you have binfmt-support installed on your PC, is to chroot in to the mount point, and reset the account as root.

 

Either way should give you a way to run "passwd <USER>" and reset the account.

 

I would not recommend copying the OS without passwd/shadow files as user and group information is stored as numbers and those files map them to names. They are also assigned dynamically, so depending on the order you install stuff, the user and group IDs between multiple computers may differ.

 

If you do feel like playing with fire, those password hashes are stored in /etc/shadow in a colon separated text file. The password hash (SHA hashes generally start with $6$) if removed, removes the password requirement from the account. Keep backups before touching this file. See "man shadow" for more details.

Posted

1, if your system is on SDcard, insert it to other linux system, them chroot to it, use passwd to change password for any users

2, id your system is on emmc, then, boot your board from sdcard, chroot to you emmc system, and use passwd to change password for any users.

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines