sudo messed UP!

Matthew Flaschen matthew.flaschen at gatech.edu
Sat May 26 21:54:02 UTC 2007


Mitch Contla wrote:
> On 5/26/07, Ricardo C O Freitas <ricardo.cofreitas at terra.com.br> wrote:
>>
>>  I was trying to add the user to cups, following cups site info:
>>
>> with this:
>>
>> usermod -G lpadmin myuser
>>
>> The result was a mess!
>>
>> Many of the services are not allowed to me as user anymore!
>>
>> When as user I type:
>>
>> sudo mc
>>
> 
> usermod can be dangerous. The correct syntax is:
> 
> $ sudo usermod -aG lpadmin myuser
> 
> The 'a' option appends the user to the group, without it, you make the user
> of the specified group and remove membership from all others. The net
> effect
> is that your user account is no longer a member of 'admin'.
> 
> For the future, Ubuntu (Debian) provides some 'friendlier' tools for user
> administration including 'adduser'. The syntax below is the preferred
> method
> for adding a user to a group:
> 
> $ sudo adduser myuser lpadmin
> 
> This would have left membership in all other groups.
> 
> Also, if you installed the cups package from the Ubuntu repositories, I
> think 'myuser' would have automatically been made a member of lpadmin.
> 
> As far as the fix goes, if you have another user account that is a
> member of
> admin, login using that account and add 'myuser' back to the appropriate
> groups. If you don't have another 'admin' account, you need to either boot
> in to single user mode

This is the recovery mode option that should be in the GRUB menu.  See
http://www.linuxtopia.org/online_books/system_administration_books/ubuntu_starter_guide/ch08.html
.

When you're logged in as root, run:

sudo usermod -aG adm,dialout,cdrom,floppy,audio myuser

But list all the groups Mitch mentioned.

Matt Flaschen

> adm
> dialout
> cdrom
> floppy
> audio
> dip
> video
> plugdev
> users
> lpadmin
> scanner
> myuser
> admin




More information about the ubuntu-users mailing list