3

The goal was to change userid, groupid to be in the same group with others.

We followed this instruction: How can I change my own user ID?

You can change it in /etc/passwd, /etc/group and /etc/shadow....

first changing passwd to user100:x:500:100:.. then changing groups file user100:x:500:100 , in shadow we did not change anything, because we did not know what to change there. After that we run the two commands below:

find / -uid 1007 -exec chown -h 500 {} +  //for userid

find / -gid 1001 -exec chgrp -h 100 {} +  //for group

Finally after hours of changing all the files: I log out and I could not log in with my password into my account anymore. After reboot only the guest account showed up.

Is there any chance I can get back my account and my data? I' am in the guest account now and there is no other root account or user account. Please help.

Update (after reversal):

grep user99 /mnt/hdd/ect/passwd

user99:x:1007:1001:Leo user99,,,:/home/user99:/bin/bash

and for group:

grep user99 /mnt/hdd/ect/group

dialout:x:20:user99
sudo:x:27:user99
plugdev:x:46:user99
users:x:1001:user99
user99:x:1001:
bumblebee:x:999:user99,syslog
docker:x:998:user99
  • Probably there is nothing wrong with your system OR your data - all that's occurred is that the lightdm login screen by default does not display accounts whose UID is < 1000 – steeldriver Feb 23 '17 at 13:08

1 Answers1

2

You can do the following in order to return everything back to the previous stage:

  • Create boot-able Ubuntu on USB DOK
  • Boot your computer with the USB DOK
  • Login as root
  • Mount your hard-disk (as user root from the USB DOK Ubuntu)
  • Assuming that computer hard-disk located at /dev/sda1

    sudo mkdir -p /mnt/hdd
    sudo mount /dev/sda1 /mnt/hdd
    
  • Revert the changes you made to the files (can be find under /mnt/hdd)

  • umount the hard-disk using:

    sudo umount /mnt/hdd

  • Power off the computer

  • Remove USB DOK
  • Power on your computer
Yaron
  • 13,173