Andy’s Blog

Just another weblog

A little knowledge really is a dangerous thing

I made a slight mistake yesterday. I managed to remove myself from the admin group. Which of course means I can no longer run ‘sudo’, which means I can’t put my self back in the group.

What happened was I wanted to add myself to a new group. For this I typed: usermod -G newgroup myuser what I didn’t realise was this replaced my list of groups instead of adding to them. Luckily I typed groups myuser to check what groups I was in. On discovering that I was not in all the groups I should be I used groups to save a copy of all the groups I was supposed to be in (this was my previous groups because I hadn’t logged out).

Unfortunately I could not replace my groups because that would require me to be root and sudo was checking I was an admin (which I no longer was).

Don’t worry though, I rebooted and selected recovery mode and restored the groups I should have had. But it just goes to show a little knowledge can be dangerous. (In hindsight it would have been wiser to have used the “Users and Groups” GUI program. Of course it could have been done using the CLI with adduser myuser newgroup).

Maybe I should create a backup admin account in case I mess something up again?

At least I have learnt something, and isn’t that what matters?


April 4, 2008 - Posted by | Uncategorized

1 Comment »

  1. This is why I always activate the root account, set a nice long password that I’ve memorised, and then leave it alone till I need it šŸ™‚

    Comment by Kirrus | April 8, 2008 | Reply

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: