Forum Moderators: bakedjake
I was thinking about simply unplugging the drive, plug it into a different machine I have, and then edit the file from there. Is there a different/better/easier way of doing this?
Failing that, you're suggestion (mount drive somewhere where you have root) and then editing the password file to remove the hash is the best/only way to go.
linux single to boot the machine into single-user mode. That might give you root access (without a password) and would allow you to edit /etc/passwd. If you don't know the root password, you can also reset it with passwd. Otherwise, can you boot the machine with a live CD? If you want to remove the hash for the root password, I think you'll have to edit
/etc/shadow rather than /etc/passwd though.
If another user has uid 0, then they have root access.
It might also be helpful to mention what OS you are running. For example, on a FreeBSD install with security turned on, you wouldn't be able to boot into single-user without knowing the password.
I had a similar problem and this thread was the first hit on google so it makes sense to add the solution :D