0

I copied my default config file to my ~/.config directory and then gave myself ownership of that file not realizing that it would give my user root permissions system wide without having to type my password for sudo. I don't like that and want to go back to having a regular user account. Here is the command I used to copy the file and change permissions:

cp -rv /etc/libvirt/libvirt.conf ~/.config/libvirt/ &&sudo chown $dino:$dino ~/.config/libvirt/libvirt.conf 

dino is my user and I guess I accidentally typed it for my group as well.

Is there a way to fix this?

waltinator
  • 35,099
  • 19
  • 57
  • 93
dino
  • 9
  • 5
  • Look in `~/.config/libvirt/libvirt.conf`. What does it say? (Anyway, that confuses me; maybe I'm too old school, but I thought `/etc/sudoers` was the only way to give someone passwordless sudo privs. – RonJohn Mar 29 '23 at 05:22
  • 3
    Does this answer your question? [Remove sudo privileges from a user (without deleting the user)](https://askubuntu.com/questions/335987/remove-sudo-privileges-from-a-user-without-deleting-the-user) – graham Mar 29 '23 at 05:53
  • Since `$dino` is an undefined variable, it expands to the NULL string, "". You did `&& sudo chown : ~/.config/libvirt/libvirt.conf`. Look at `ls -l ~/.config/libvirt/libvirt.conf` - it's probably owned by `root:root`. To fix: `sudo chown $(id -u):$(id -g) ~/.config/libvirt/libvirt.conf`. – waltinator Mar 29 '23 at 06:42
  • Thank you waltinator. That fixed it! I knew it had something to do with the group variable but wasn't sure how to fix. I'm trying to set permissions for QEMU. I'm trying to get a VM up and running but I'm having problems getting my permissions right. I'm sure system wide root privileges is one way to fix it but that's not the solution for me. I'll figure out another way. Thanks for your help. – dino Mar 29 '23 at 14:07

0 Answers0