newpsswd1 Posted October 20, 2021 Posted October 20, 2021 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!!
tparys Posted October 21, 2021 Posted October 21, 2021 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.
ning Posted October 21, 2021 Posted October 21, 2021 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.
Recommended Posts