How to add my user account to admin group (13.10 desktop)

27,988

Solution 1

Its Not recommended to add users to root group .

sudo usermod -aG (nameofgroup) (nameofuser) 

the user will be a member of the group .

You can use chown to give the user the owenership :

sudo chown username:usergroup /path -R 

-R means recursive so user well be the owner also of subfolders .

Now you can give the user who owned this directory a full access by :

sudo chmod 755 /path 

755 means (drwxr-xr-x) read write execute permissions for the owner .

Solution 2

So after chowning i was able to modify what i needed, however this seems to have created some other issues with installed packages, or possibly more likely the several attempts to modify group permissions etc caused issues, so reimaged the unit and did the following...

How to enable root login?

Provided you are not concerned about security I feel this the the best solution. The other solutions SHOULD have worked, but didnt so I can only assume its due to much buggering on the part of ubuntu.

Thanks for those who offered guidance.

Note to Ubuntu, if I wanted to be locked out of my system I would buy a mac

Share:
27,988

Related videos on Youtube

brettnelson
Author by

brettnelson

Updated on September 18, 2022

Comments

  • brettnelson
    brettnelson over 1 year

    I was trying to extract a web template into the hosting folder /docroot on the web service, which is working, however I do not have permission to complete the action.

    I cannot stand being locked out of anything on a machine, and before you all go on a rant about why the root account is locked yadda yadda , dont, just dont.

    So... did a sudo visudo

    # User privilege specification
    root    ALL=(ALL:ALL) ALL
    username   ALL=(ALL:ALL) ALL
    

    saved as tmp and then as sudoers , checked the files, both sudoers and sudoers.tmp same size

    Still no joy, cannot access required folders and files. Rebooted, no go

    I was about to start editing the passwd files next, but thought I best ask what might be going on here as I am not entirely familiar with Ubuntu 13.10 desktop and Unity.

    This is not a production machine, only experimenting with web services and the available web production tools. I get the root account is locked and sudo 'ing every command from the command line is not an option, just aggro.

    If anyone can offer a (even if unsecured) solution to this permissions issue I would be very grateful. I do not care about breakage, please do not lecture, I can re-image this unit in less than 20 min.

    I tried adding my account to the admin group as well, only to get an error saying the admin group doesn't exist.

    # Members of the admin group may gain root privileges
    %admin ALL=(ALL) ALL
    

    huh? Yep, confused. TIA

  • brettnelson
    brettnelson about 10 years
    [sudo useradd -G admin username]..... useradd: group 'admin' does not exist
  • brettnelson
    brettnelson about 10 years
    I would be inclined to change the ownership on the entire drive, but do not know what that would do to the apps/services
  • nux
    nux about 10 years
    useradd -G root username
  • Takkat
    Takkat about 10 years
    There is no admin in 13.10 - you may by looking for group sudo.
  • nux
    nux about 10 years
    its not recommended man
  • nux
    nux about 10 years
    @Takkat what command should be used
  • brettnelson
    brettnelson about 10 years
    Members of the admin group may gain root privileges..... %admin ALL=(ALL) ALL.....looks like an admin group
  • Takkat
    Takkat about 10 years
    its usermod -aG (preferred) or adduser.
  • nux
    nux about 10 years
    @ brettnelson if the answer help you mark it a good answer to help others
  • brettnelson
    brettnelson about 10 years
    usermod: Permission denied. usermod: cannot lock /etc/passwd; try again later...... tried usermod -aG root username (error above)
  • brettnelson
    brettnelson about 10 years
    There seem to be several ways to do this, yet none work lol helarious
  • brettnelson
    brettnelson about 10 years
    dammit, got ahead of myself, thanks, regardles tho I still do not understand why the sudo visudo edit did not work, thats the way it should have been handled , rather than ading myself to the root, correct?....or for that matter why the admin group IS listed in teh sudoers file, dont get it
  • brettnelson
    brettnelson about 10 years
    no go, adding to root did not work
  • nux
    nux about 10 years
    did you try to change the owner of the directory
  • brettnelson
    brettnelson about 10 years
    before I go changing owners I would like to understand the sudo visudo issue.
  • brettnelson
    brettnelson about 10 years
    username:x:0:0:,,,:/home/username:/bin/bash.......changed in the passwd file, but wont let me save, permissions error again
  • brettnelson
    brettnelson about 10 years
    Anyone care to tackle why this doesnt work.....?.......# User privilege specification root ALL=(ALL:ALL) ALL username ALL=(ALL:ALL) ALL
  • brettnelson
    brettnelson about 10 years
    sudo usermod -aG sudo username --------although no errors reported, doesnt seem to do anything either
  • rosscova
    rosscova over 7 years
    An old topic I know, but I'm having the same problem as you, and have been racking my brain as to what's going on. Ubuntu 16.04 LTS. I'm going with enabling root login, as silly as it seems.