Administrator removal

Solved
Hello,

I could really use some help as I found no solution on your forum, so here it is:

As the session administrator, I went to the "user" tab (a few days ago) and I accidentally changed my profile status from "administrator" to "normal" user. Since then I can't restore the administrator mode, the password keeps being rejected, I can no longer make any changes.

Please kindly help me.

Configuration: HP Laptop PC
Windows 7 and Ubuntu Linux 11.10

4 answers

  • Votes
  • Date
  • Descending date
    1. Hello, thank you, but what you gave me talks about a password issue whereas for me it's an issue of user account status: I no longer have an administrator!
      How can I create a new administrator account?
      Should I do it with a live CD?

      Please kindly help me.
    2. The administrator account still exists; it is “root.” What you have lost are the administrative rights for your user account. To restore them, you need to identify yourself as root, and from this session you can rectify your mistake. By default on Ubuntu, the root account is disabled and you need to use a LiveCD to have full rights. Once identified as root, you must add your user back to the admin group with the command
      usermod -a -G admin your_username
    3. Thank you very much! But one thing, how can we get root on a live CD?
    4. Open a terminal and type the command sudo su. It is also necessary to mount the system partition of your hard drive and chroot into it before you can run the usermod command.
  1. Hello,

    How to mount my system partition?
    What does "chroot" mean, I don’t understand what you mean and could you explain the steps to take because I am a beginner/amateur on Ubuntu.

    Have a good day
    1. to mount a partition, after doing the sudo su:

      mkdir /media/truc
      mount -t ext4 /dev/sdxy /media/truc

      assuming it’s an ext4 partition (if you’re not sure, there’s a good chance that’s what it is).
      You have to replace x and y with the letter corresponding to your hard drive ( a for the 1st, b for the 2nd, etc ) and y with the partition number where Ubuntu is installed ( 1, 2, etc ). If you have a doubt, run

      fdisk -l

      which will give you the list of your disks, partitions, and their type ( note, it’s a lowercase L, not the number 1 )

      Then,

      chroot /media/truc

      Then the usermod
      1. Hello again,

        I followed step by step the procedure you suggested, and it worked to fix the problem and recover my account in administrator mode.
        I don’t know how to thank you, but you pulled me out of a real dead end!

        Thanks to you and everyone!

        Have a wonderful day everyone!
        1. There's nothing to it ;)