I have an external hdd partitioned into two. One of the partitions has Linux (Ubuntu) installed on it (bootable). The thing is I have forgotten the password of it's user (single user).
How can I reset the password of user by plugging the external hdd to another Linux machine and then editing some file, using some command through terminal, changing the bash(remember doing something similar long time ago), or something else?
And I do not want to get into Grub etc. Booting through that drive is not an option (although it is but I am not willing to get into it and don't want to restart the running("another") Linux machine).
chrootis indeed safer than manually editing/etc/shadow. – michas Dec 15 '13 at 21:43chrootwill not work if mount is from a different architecture (e.g, x86 vs ARM) because chroot runs /bin/bash – Aleksandr Levchuk Aug 05 '18 at 19:16passwd -R /run/media/username/drivename rootBut I gotpasswd: Cannot determine your user name.– Scindix Aug 21 '18 at 14:29