Lost some of account rights
Rashkae
ubuntu at tigershaunt.com
Sat Apr 28 21:20:27 UTC 2007
Patton Echols wrote:
> On 04/28/2007 11:48 AM, OOzy Pal wrote:
>> I was trying to add me login name to group www-data so I did
>>
>> usermod -g www-data hab
>> usermod -G www-data hab
>>
>> now, I lost my system menu. When I click on System I see only limited
>> items. How can I re-gain my right.
>>
>>
> FWIW, I'm pretty much a noob, but reading some man pages . . .:
>
> It looks like the problem is the use of the "-G" option. The man page
> says that, if you don't list all your existing groups, then "usermod -G"
> will remove the user from any groups not listed. So to add yourself
> back, you need to list all of the groups you should belong to.
>
> Here is the section from man usermod
> "
> -G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
> A list of supplementary groups which the user is also a member of.
> Each group is separated from the next by a comma, with no
> intervening whitespace. The groups are subject to the same
> restrictions as the group given with the -g option. If the user is
> currently a member of a group which is not listed, the user
> will be
> removed from the group. This behaviour can be changed via -a
> option,
> which appends user to the current supplementary group list.
>
> "
>
> And here is the output on my system of "grep patton /etc/group"
>
> adm:x:4:patton
> dialout:x:20:cupsys,patton
> cdrom:x:24:haldaemon,patton
> floppy:x:25:haldaemon,patton
> audio:x:29:patton
> dip:x:30:patton
> video:x:44:patton
> plugdev:x:46:haldaemon,patton
> lpadmin:x:109:patton
> scanner:x:111:cupsys,hplip,patton
> patton:x:1000:
> admin:x:114:patton
>
> If my system is typical, then you would want to do:
>
> usermod -G
> adm,dialout,cdrom,floppy,audio,dip,video,plugdev,lpadmin,scanner,hab,admin
>
> WARNING: man usermod also says that the groups must exist. Check to be
> sure before you do this.
>
> Better yet, see if someone who really knows can give you a better answer.
>
> GL
>
Unfortunately, with the -G option that was used, the only admin account
(which gives you right to sudo) was nuked.
You'll have to reboot into a root shell and add yourself to the admin
group from there. (Sorry, I don't remember how Ubuntu boot menu is setup
by default, and can't verify atm)
For future reference, the command to add an account to a group is usermod -a
-g will overwrite your default group (something you probably don't want
to do), and as you've seen, -G will eliminate all your group memberships.
More information about the ubuntu-users
mailing list