0

I was tinkering with the /etc/passwd file when accidentaly changed the root UID and GID. When I enter into the recovery mode, I still have no superuser powers, as any user exists on the passwd file with UID and GID 0. I read something about booting the pc from a live cd and mounting a partition, but I don't fully understand what does this mean. Maybe you can give me a solution and a link to a tutorial or just explain it here step by step. Thank you in advance :)

1
  • Something like this
    – xenoid
    Commented Jun 27, 2017 at 8:23

1 Answer 1

0

A little bit like this: https://help.ubuntu.com/community/LiveCdRecovery

You boot Linux from the Live CD (not using it as a replacement boot loader, but booting into the Live CD installation).

Then mount the partition containing / of your hard disk installation, similar to the tutorial.

Stop before doing chroot! Just cd the the directory where you mounted it, enter etc, cp passwd passwd.backup for good measure (in case your cat jumps on the keyboard one moment later) and vi passwd.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .