I messed up some config files, now all my users have lost sudo priv :(

Cedric cedric.dewijs at tiscali.nl
Mon Jul 2 21:34:27 UTC 2007


On Monday 02 July 2007, Gabriel Dragffy wrote:
> Today I did something insanely stupid.
>
> I added a user using useradd (strange that eh?). OK so I wanted to let
> this new user have sudo privs.
>
> What I did was this (don't laugh at me!):
> sudo vim /etc/group
>
> Then appended the new user name to the end of the same groups as the
> original user (groups such as adm, and admin). Saved and exited. I try
> to run superuser command with the current user (the original one) it
> tells me I'm not in the sudoers file!?? Change to the newly created
> user, and the same story. Now I've lost all admin privs, and there is no
> way I can fix it until I get to work and reboot in recovery mode.
>
> My question is - how to fix it? What did I actually break?
>
> essentially my group files looked something like:
> admin:x:108:originaluser:newuser:
>
> Thanks so much for the help. My life is on the line with this one
> because the server is an essential web and svn server for the company  -
>   argh!!

The first thing you have to do is to become root. This can be done by booting 
from a linux CD (knoppix for instance) or you can append init=/bin/sh to the 
line used to start the kernel. This bypasses init, and gives you a root 
login. (I'm tired, and typing from memory. If there's an error in my 
statement, please correct me.)

Best regards,
Cedric.
-- 
The only stupid question is the one you don't ask




More information about the ubuntu-users mailing list