0

Some time ago I had this problem and I found a workaround by issuing following command

  sudo chmod 777 /dev/dri/card0

and leaving me with this bug.

I have been struggling to fix it for a week. Today I ran

  groups $USER

it printed

  kenn : www-data wheel

I thought that it would be a good idea to add current user into other groups, so I ran

  sudo usermod -G adm,disk,mail,cdrom,floppy,sudo,audio,dip,video,plugdev,fuse,lpadmin,netdev,sambashare,debian-tor,wireshark  kenn

I logged out and logged in but it did nothing. So I wanted to revert changes I made and deleted groups I added to current user by

   sudo usermod -G www-data,wheel  kenn

it supposedly reverted the change, I checked again

   groups $USER
   kenn : www-data wheel

But when I logged out I could not log in.

I logged in and opened terminal but now I can not run command with sudo

I get Sorry, user kenn is not allowed to execute '/usr/sbin/adduser as root on kenn

How can I revert changes I caused?

How can I add current user to adm and sudo groups?

EDIT: I managed to add myself to sudo and adm group from root account. And then ran

  sudo usermod -aG adm,disk,mail,cdrom,floppy,sudo,audio,dip,video,plugdev,fuse,lpadmin,netdev,sambashare,debian-tor,wireshark  kenn

But I don't know which more ones to add

I still dont understand what I did wrong.

It must be related to usermod -G switch instead of usermod -aG

  id

returns

  uid=1000(kenn) gid=33(www-data) groups=33(www-data),4(adm),6(disk),8(mail),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),104(fuse),108(lpadmin),109(netdev),124(sambashare),129(debian-tor),148(wireshark),1010(wheel)

I need to know default groups that any admin account must have

  • It sounds like you messed up you usergroup membership(s), not your home folder permissions: start with How do I add myself back as a sudo user? and we'll take things from there – steeldriver Dec 10 '15 at 18:02
  • @steeldriver Thanks for the info. I managed to add myself to sudo and adm group from root account. And then run sudo usermod -aG adm,disk,mail,cdrom,floppy,sudo,audio,dip,video,plugdev,fuse,lpadmin,netdev,sambashare,debian-tor,wireshark kenn But I don't know which more ones to add – kenn Dec 10 '15 at 18:21
  • That looks like plenty, unless you are having specific access problems? Is your primary group (usually the same as your username) intact? You can use the id command to check. – steeldriver Dec 10 '15 at 18:28
  • I added id output in my updated question – kenn Dec 10 '15 at 18:36
1

Your home directory as well as the .Xauthority file both belong to your user kenn, however you've modified your user to belong only to www-data wheel.

My example (user is xieerqi ):

$ ls -ld /home/xieerqi
drwxr-xr-x 90 xieerqi xieerqi 16384 Dec 10 11:15 /home/xieerqi/

xieerqi:
$ ls -l .Xauthority                                                                           
-rw------- 1 xieerqi xieerqi 450 Dec 10 06:44 .Xauthority

What you need to do is to go into recovery mode (since you no longer belong to sudo group), enter root shell, remount filesystem with read write permissions (via mount -o rw,remount /), and run

usermod -a -G kenn,sudo,adm,dip,plugdev,lpadmin kenn

Additional info:

  • Serg thank you for your answer and the info. I edited my question and provided more info. As I stated in edit section, I managed to login to root account and added kenn user to adm,disk,mail,cdrom,floppy,sudo,audio,dip,video,plugdev,fuse,lpadmin,netdev,samb‌​ashare,debian-tor,wireshark You also provided more groups. Aren't they enough to provide to fix privilege issue? Do I have go recovery mode and follow the steps you wrote for completeness? – kenn Dec 10 '15 at 20:17
  • Output of ls -ld /home/kenn is drwxr-xr-x 387 kenn www-data 20480 Dec 10 20:13 /home/kenn – kenn Dec 10 '15 at 20:21
  • @kenn adding yourself to groups should fix the permissions issue. Check the ownership of .Xauthority file in your home folder, make sure it belongs to your user. It's a frequent problem with GUI login, it may be at play as well. – Sergiy Kolodyazhnyy Dec 10 '15 at 20:23
  • .Xauthority seems to be ok. ls -l .Xauthority -rw------- 1 kenn www-data 49 Dec 10 20:13 .Xauthority – kenn Dec 10 '15 at 20:32
  • @kenn you have over 21 reputation, which means you can join the AskUbuntu general chat We can continue discussion there – Sergiy Kolodyazhnyy Dec 10 '15 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.