LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   username in sudoer group but need to sudo all the time (https://www.linuxquestions.org/questions/linux-newbie-8/username-in-sudoer-group-but-need-to-sudo-all-the-time-4175476211/)

NTH 09-06-2013 01:46 PM

username in sudoer group but need to sudo all the time
 
Hi,
I recently installed Ubuntu 12.0.4 LTS. I am already admin and in the sudoers group:

Code:

root@machine:# groups username
username : username adm cdrom sudo dip plugdev lpadmin sambashare

but the problem is that my username does not have permission to copy/generate files and run programs in my home directory and I need to become root all the time or change the permissions of the file or directory to be able to access or modify it. How can I give my username this permissions?
Thanks

Keith Hedger 09-06-2013 02:03 PM

Looks like all your permissions are fubared try
Code:

sudo chown -R YOURUSERNAME:YOURUSERNAME /home/YOURUSERNAME
Replace YOURUSERNAME with your own username of course or if worse comes to worse login as root delete your user ( back up any important files first ! ) then re-add your user.

NTH 09-06-2013 02:34 PM

Quote:

Originally Posted by Keith Hedger (Post 5023216)
Looks like all your permissions are fubared try
Code:

sudo chown -R YOURUSERNAME:YOURUSERNAME /home/YOURUSERNAME
Replace YOURUSERNAME with your own username of course or if worse comes to worse login as root delete your user ( back up any important files first ! ) then re-add your user.

This solved it. The only change I had to make was that I did not use sudo in the above command. root did not have permission to change ownership. Thanks for the help!.

Firerat 09-06-2013 02:42 PM

Odd that sudo couldn't do it

what do you get from ( as your normal user )

Code:

sudo -l
that lists your users sudo setup,
the default on ubuntu should have "(ALL : ALL) ALL" in it

NTH 09-06-2013 02:51 PM

Quote:

Originally Posted by Firerat (Post 5023240)
Odd that sudo couldn't do it

what do you get from ( as your normal user )

Code:

sudo -l
that lists your users sudo setup,
the default on ubuntu should have "(ALL : ALL) ALL" in it

Here is the output:

Code:

Matching Defaults entries for username on this host:
    env_reset,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User username may run the following commands on this host:
    (ALL : ALL) ALL

This is after I did chown. I guess it looked the same before but I'm not sure.

Firerat 09-06-2013 03:11 PM

yeah, it would have been the same.

I might try and break a VM tomorrow, see if I can get the same broken sudo.


All times are GMT -5. The time now is 02:25 AM.