Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: Deleting User

  1. #21
    Join Date
    Apr 2012
    Beans
    5,169

    Re: Deleting User

    Yeah the bulletin board software treats things like :x as smilies - you have to go the Miscellaneous Options and check the 'Disable smilies in text' box (or enclose the text in CODE tags)

    Regardless it shows your sudoers group is empty so yes its recovery mode or chroot

  2. #22
    Join Date
    Oct 2008
    Location
    UK
    Beans
    1,069
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Deleting User

    My pc will not boot into recovery mode so I will have to use a liveCD. Can you help me - I'm booting to liveCD and reading this forum on a spare laptop.

  3. #23
    Join Date
    Apr 2012
    Beans
    5,169

    Re: Deleting User

    bapoumba has outlined the steps - first thing once you are booted into the live environment is to find out how your installed system is partitioned so you know what bits to mount for the chroot

    Code:
    sudo fdisk -l
    It will produce a bunch of 'stuff' - all you are really interested in at this stage is the bit that looks like

    Code:
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048   117223423    58610688    7  HPFS/NTFS/exFAT
    /dev/sda2       117225470   195371007    39072769    5  Extended
    /dev/sda5       117225472   149223423    15998976   83  Linux
    /dev/sda6       149225472   187367423    19070976   83  Linux
    /dev/sda7       187369472   195371007     4000768   82  Linux swap / Solaris

  4. #24
    Join Date
    Oct 2008
    Location
    UK
    Beans
    1,069
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Deleting User

    Below is a picture of my output
    Attached Images Attached Images

  5. #25
    Join Date
    Apr 2012
    Beans
    5,169

    Re: Deleting User

    OK based on that it looks like your root partition is on /dev/sdb2 - so the steps would be

    1. create mount points for the chrooted environment (some of these may not be essential but it won't do any harm to create them all). The choice of 'sdb2' for the root mountpoint is arbitrary - call it whatever you like.
    Code:
    ubuntu@ubuntu:~$ sudo mkdir -p /mnt/sdb2/{dev,proc,run,sys}
    2. mount the root block device of your HDD to the root mountpoint that you created in step (1)
    Code:
    ubuntu@ubuntu:~$ sudo mount /dev/sdb2 /mnt/sdb2
    3. bind mount the additional directories for the chrooted environment
    Code:
    ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/sdb2/dev
    ubuntu@ubuntu:~$ sudo mount --bind /proc /mnt/sdb2/proc
    ubuntu@ubuntu:~$ sudo mount --bind /run /mnt/sdb2/run
    ubuntu@ubuntu:~$ sudo mount --bind /sys /mnt/sdb2/sys
    4. chroot into the HDD filesystem
    Code:
    ubuntu@ubuntu:~$ sudo chroot /mnt/sdb2
    5. let's just check we are in the correct filesystem and confirm that group 'sudo' is messed up
    Code:
    root@ubuntu:/# getent group sudo
    sudo:x:27:
    6. now let's do the actual fix by adding our user to the 'sudo' group
    Code:
    root@ubuntu:/# gpasswd --add steeldriver sudo
    Adding user steeldriver to group sudo
    7. check that it worked
    Code:
    root@ubuntu:/# getent group sudo
    sudo:x:27:steeldriver
    8. OK we're done here - we can exit from the chroot environment
    Code:
    root@ubuntu:/# exit
    exit
    ubuntu@ubuntu:~$
    9. back in the live disk environment - we should cleanly unmount the chrooted filesystem
    Code:
    ubuntu@ubuntu:~$ sudo umount /mnt/sdb2/{dev,proc,run,sys}
    ubuntu@ubuntu:~$ sudo umount /mnt/sdb2/
    10. now you can exit from the live environment and boot back into your regular system
    Last edited by steeldriver; December 18th, 2013 at 05:14 PM.

  6. #26
    Join Date
    Oct 2008
    Location
    UK
    Beans
    1,069
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Deleting User

    Wow - that did it. I have my machine back. Many thanks for all your work - I appreciate what you did this afternoon.

  7. #27
    Join Date
    Sep 2006
    Location
    France.
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Deleting User

    So many many thanks steeldriver. I'm not comfortable with the chroot environment as my previous encounters were miserable fails and was not sure you had to bind other files for adding a user to the sudo group. I had no time to test it (and believe it or not, I should not even take the time to answer here..).

    Very glad you got it fixed, Quarkrad.

    This little story reminded me why I _always_ keep an additional user with admin privilege _and_ the last working kernel on any system I use (Linux or MacOS) or feel responsible for (kids..). Not even talking about backups.
    | My old and mostly abandoned blog |
    Linux user #413984 ; Ubuntu user #178
    J'aime les fraises.
    Nighty night me lovelies!

    | Reinstalling Ubuntu ? Please check this bug first ! |
    | Using a ppa ? Please install ppa-purge from universe, you may need it should you want to revert packages back |
    | No support requests by PM, thanks |

Page 3 of 3 FirstFirst 123

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •