Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
Last week I was experimenting with some bleeding edge pulse audio / HDMI stuff and something got fouled, bad. Long story short I *think* I tracked it back to a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User Steven_G's Avatar
    Join Date
    Jun 2012
    Location
    Western US
    Posts
    417

    Change system-wide "default" admin profile?


    Last week I was experimenting with some bleeding edge pulse audio / HDMI stuff and something got fouled, bad.

    Long story short I *think* I tracked it back to a corrupted permission in the home folder of the user I created at install (user 1) and for the life of me I couldn't get it fixed.

    I ended up creating a new user and migrating *everything* from user 1 to user 2.

    After lots of config and touble shooting I think I've solved every problem but 1:

    When I use "deep" GUI tools like synaptic or users and groups they ask for the password of user 1 instead of user 2.

    How do I tell the system that user 1 is no longer the default admin profile and that user 2 is now the default admin so I can delete the old corrupted user profile?

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Replace User1 with User2 in /etc/sudoers file. Make sure not to edit anything else. Use visudo to edit sudoers file.
    Code:
    sudo visudo
    You can edit /etc/sudoers file using any other text editor but using visudo is highly recommended. visudo checks the syntax of the file and not allow you to save it if there is bad syntax.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Linux User Steven_G's Avatar
    Join Date
    Jun 2012
    Location
    Western US
    Posts
    417
    Ok thanks for the tip. I'll check when I get home (work / memory /senile). But I thought I did that already?

  4. $spacer_open
    $spacer_close
  5. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Ok thanks for the tip. I'll check when I get home (work / memory /senile). But I thought I did that already?
    I don't think you have edited sudoers file. If you replace User1 with User2 in sudoers, there is no way you can use User1's password for administrative tasks.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  6. #5
    Linux User Steven_G's Avatar
    Join Date
    Jun 2012
    Location
    Western US
    Posts
    417
    Like I said: work /memory/senile.

    Now, thinking about it, I *think* I might have both user 1 and user 2 in sudoers. I think I left the old in so I could su between them and have sudo powers on both profiles as I worked to migrate everything.

    Is there like an order of placement preference for who is default? I ask because if they're both still in there then they're listed:

    User2
    User1

    Is the last one in the list the "default" or is User1 still default because I haven't removed it from the file yet?

  7. #6
    Linux User Steven_G's Avatar
    Join Date
    Jun 2012
    Location
    Western US
    Posts
    417
    Actually, I just checked and I was right the first time. User2 is the only one at the bottom of the file when I open sudo visudo. Where else can I look?

  8. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Could you post the contents of /etc/sudoers file here?
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  9. #8
    Linux User Steven_G's Avatar
    Join Date
    Jun 2012
    Location
    Western US
    Posts
    417
    Code:
    #
    # This file MUST be edited with the 'visudo' command as root.
    #
    # Please consider adding local content in /etc/sudoers.d/ instead of
    # directly modifying this file.
    #
    # See the man page for details on how to write a sudoers file.
    #
    Defaults	env_reset
    Defaults	secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    
    # Host alias specification
    
    # User alias specification
    
    # Cmnd alias specification
    
    # User privilege specification
    root	ALL=(ALL:ALL) ALL
    
    # Members of the admin group may gain root privileges
    %admin ALL=(ALL) ALL
    
    # Allow members of group sudo to execute any command
    %sudo	ALL=(ALL:ALL) ALL
    
    # See sudoers(5) for more information on "#include" directives:
    
    #includedir /etc/sudoers.d
    bella ALL=(ALL) ALL
    %jupiter ALL=NOPASSWD: /usr/lib/jupiter/scripts/bluetooth, /usr/lib/jupiter/scripts/camera, /usr/lib/jupiter/scripts/cpu-control, /usr/lib/jupiter/scripts/resolutions, /usr/lib/jupiter/scripts/rotate, /usr/lib/jupiter/scripts/touchpad, /usr/lib/jupiter/scripts/vga-out, /usr/lib/jupiter/scripts/wifi
    And now I've really screwed myself. I'm mostly a GUI guy. I tired disabling the User1 profile in users and groups. So now I'm locked out of synaptic, user and groups, updates, ect because they are still asking for the User1 password.

    Until I get this fixed how do I re-enable the User1 profile from the command line?

  10. #9
    Linux User Steven_G's Avatar
    Join Date
    Jun 2012
    Location
    Western US
    Posts
    417
    OK, I found
    Code:
    passwd -u username
    and unlocked User1 profile so I can now perform GUI admin functions again. But, for the life of me I can't figure out how to get User1 to stop being default admin. I even tried changing User2 (bella) to UID:GID 1000:1000 and User1 (nancy) to 1003:1003. In users and groups I've also "demoted" nancy from an admin profile to a user profile.

    But, somewhere in the system she's still listed as the default admin profile.

  11. #10
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    It looks like User1 is in sudo group and User2 is not. Execute id command as User1 and User2. Check if there is any difference in Groups.
    Add User2 in sudo Group. You can do it in GUI as well as through command line.
    Code:
    sudo usermod -a -G sudo user2
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •