2

after I created a group, and put the root account in it, I lost control of it and now it's not root anymore. Also I can't login with "root". How can I revert this? Now there is no way I can use sudo commands. And I don't know what account the control has!

/etc/group looks like this:

root:x:0
...
developers:x:1004:thomas,website
4
  • I do not see a question ;-) but if you want to restore/reset etc sudo permissions you can do so from either grub or a live cd. The root:x:0 is correct. Have a look at /etc/sudoers. Should contain root ALL=(ALL:ALL) ALL
    – Rinzwind
    Jul 28, 2012 at 20:39
  • howtogeek.com/howto/linux/… Jul 28, 2012 at 20:42
  • /etc/sudoers and /etc/sudoers.d are both empty! And @Ysangkok it's the server edition so I cannot follow the tutorial since I cannot "try" it out!
    – tversteeg
    Jul 28, 2012 at 20:44
  • @ThomasVersteeg: The desktop live CD will work even with your server installation. You can use KNOPPIX or SystemRescueCd too. Jul 28, 2012 at 21:58

1 Answer 1

0

Not being able to login as root (other than by using sudo) is normal; Ubuntu doesn't set a password for root by default.

The empty /etc/sudoers means you can't use sudo, of course. But creating a new group shouldn't affect /etc/sudoers. You must have done something else.

The way to recover from this (short of reinstalling) is to boot into a single-user root shell. From there, you can fix /etc/sudoers, and whatever else needs fixing. Be careful while you're doing this; it's very easy to break the system by manually editing system files like this and frankly you've already done so.

To get a single-user root shell, see this question. Quick summary: Hold down the left shift key while booting and follow the prompts to get a root shell.

1
  • The problem was with the disk, it was set on read-only and I had to fix that to be able to change the permissions of /etc/sudoers so I could add myself as admin, thank you!
    – tversteeg
    Jul 29, 2012 at 12:08

You must log in to answer this question.

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