Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was trying to add myself to a certain group, so I issued the command in Ubuntu:
Quote:
sudo useradd -G newgroup
Now when I do:
Quote:
groups myusername
I am ONLY in the group "newgroup". I LOST MY SUDO PRIVILEGES!!! How do I get this back? there is NO root account in Ubuntu. Any ideas? I did this on a WORK computer and I am the only system admin on it. If I can't get in, then I can't retrieve the files!!!! HELP!!
Boot into the single user mode (runlevel 2, if I'm right?) and alter /etc/group --> add yourself into the group sudoers (I hope it wasn't "sudo"..nope, I think it's "sudoers"), save and reboot. And next time remember to set bootloader password so nobody else can do this
But---it is easy to fix. Once you get your sudo powers back, do this:
sudo passwd root
You'll be prompted for your password, and then to enter the new root password.
Interestingly, Distros based on Ubuntu have not propagated this silliness.
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Original Poster
Rep:
Problem fixed, guys! Booting into the RECOVERY MODE at the GRUB menu worked. I just inputted my root password, which I created during the Ubuntu installation. I added myself back to the admin group and all is fine. The only annoyance is that I had to drive over to the site and physically reboot the machine.
I am going to pass on creating a "root" account. I've seen my server trying to get hacked so many times. The most common attempt is the user "root". I'm fine with sudo and consider it an extra layer of security rather than a nuisance.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.