I'm afraid I locked myself out of the sudo/root options. The one account that had sudo rights now reports that it doesn't have these anymore. How can I restore this? Do I need to use a live stick?
-
What errors occur?– WilfFeb 28, 2015 at 16:19
-
3See askubuntu.com/questions/487003/… If that link does not solve your problem we need more information. Simply stating it is broken is insufficient. What command are you running ? what error message ? what did you to to get this result (chmod -R 777 / , chown -R user:user /, usermod ?) ? Could be most anything.– PantherFeb 28, 2015 at 16:26
-
Did you set your root password after installation?– Ankit SinghaniyaFeb 28, 2015 at 17:26
-
The duplicate link was an almost exact copy of my situation. Thanks for the tips!– SPRBRNMar 1, 2015 at 12:44
2 Answers
- Drop into the root shell as described here.
- Change the root password by giving the command
passwd root
- Change the passwords of the other users by the command
passwd username
No sudo rights for your user can be caused due to multiple reasons.
I suggest trying Naveen's answer first, but in some cases dropping to the root shell doesn't work (for instance, you get the message "Give root password for maintenance").
In the latter case, you should try booting an Ubuntu Live CD, and mount the partition that contains your Ubuntu filesystem and you should chroot
to your root filesystem.
In the case your user isn't part anymore of the sudo group (you can check this by issuing groups <username>
from your terminal), you'll have to re-add your user to the sudo group:
adduser <username> sudo
,
Also make sure the /etc/sudoers
file contains the following entry for the sudo group:
%sudo ALL=(ALL:ALL) ALL
This website shows the first part of this procedure in more detail
-
you can still do this from root shell even mounting
/
check the link in a comment posted by bodhi.zazen it works.– JoKeRFeb 28, 2015 at 17:19