oh no! Destroyed my admin account using USERMOD :(
Alan McKinnon
alan at linuxholdings.co.za
Mon Jul 10 06:37:50 UTC 2006
On Mon, 2006-07-10 at 11:24 +0800, Gabriel M Dragffy wrote:
> Hi,
> I wanted to add my default superuser to the nogroup group. I couldn't
> find a gui tool in gnome so I read the man page of usermod. I ran the
> command $sudo usermod -Gnogroup gabe
> I thought this would have added me to the group but it seems to have
> removed all the other groups and now I can't do anything with my
> computer. I still have a terminal open so I can run sudo for the next
> fifteen minutes, and I'm going to set a root password. Could someone
> please tell me the default groups that the superuser is in?
> Then I will add my user back in. Please respond quickly!!
So you got caught out as well :-)
usermod -G is intended to be used when the user is first created, where
you list all the supplementary groups the user will be a member of. It
removes all groups, then adds the list you provide. For future
reference, the command you wanted was:
gpasswd -a <username> <group>
which adds the user to the group and leaves all others unaffected.
You want to add user gabe to the admin group to be able to sudo.
alan
More information about the ubuntu-users
mailing list