Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: how to give a user sudo privilege from command line?

  1. #1
    Join Date
    Mar 2006
    Location
    South Africa, Secunda
    Beans
    137
    Distro
    Ubuntu 12.04 Precise Pangolin

    how to give a user sudo privilege from command line?

    Good day all, I have a bit of a problem. I adjusted some settings in the desktop settings folder in KDE. I had only one user account on the machine. Next time I rebooted I could not log into KDE (it kept bombing out). I had to log into the console. Finally I managed to create a new account with useradd but this user cannot sudo…

    *

    My problem is that my home directory is encrypted, so I need a new user with sudo privileges to delete all the kde files and folders in my original users home directory so that I can start with a new KDE setup (which won’t be a bad thing since I tinkered a lot).

    *

    How can I add sudo privileges to the new account (I presume I can do it by logging in with my sudo account in a terminal login?

    *

    Please kind ubuntu population assist me with getting my music, videos and docs back

  2. #2
    Join Date
    Oct 2007
    Location
    Chennai, India
    Beans
    3,786
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: how to give a user sudo privilege from command line?

    Quote Originally Posted by georgelappies View Post
    How can I add sudo privileges to the new account (I presume I can do it by logging in with my sudo account in a terminal login?
    I cannot understand how giving a new username sudo privileges will help you, but you can do this by adding the newuser to the admin group
    Code:
    sudo adduser newusername admin
    If you do not have access to sudo at all, please reboot into the recovery console's root terminal.
    Cheers,PRShah
    Make your own: Ubuntu, Kubuntu, Xubuntu, Mythbuntu All-in-One Live DVD
    "I never make mistakes; I thought I did, once.. but I was wrong."

  3. #3
    Join Date
    Mar 2006
    Location
    South Africa, Secunda
    Beans
    137
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to give a user sudo privilege from command line?

    Thanks, won't a sudo user have access to my old home directory even if I need to supply a password to open it. I wanted to delete all files and folders in my old home directory exept /music /data /videos /opt /Documents thus forcing Kde to create new config files ans folders and allowing me to log in and not crash when trying to login with saved incompatible settings?

    Perhaps any other suggestions? I guess I can delete these via commandline but it will be much quicker via graphical interface (I am a noob wrt command line still )

  4. #4
    Join Date
    Dec 2010
    Location
    Earth
    Beans
    142
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: how to give a user sudo privilege from command line?

    see also

    Code:
    man sudoers
    -and as root-
    Code:
    gedit /etc/sudoers
    search the web for /etc/sudoers to have more human reading info like
    http://www.ghacks.net/2010/01/06/how...to-etcsudoers/
    this gui is not ubuntu! but get u searching in right direction
    but thats problem more then any ever uses
    Last edited by highspider; March 14th, 2011 at 08:52 AM.
    In a perfect world my college professors would allow assignment as .odt openoffice.org files! And code as Eclipse projects.

  5. #5
    Join Date
    Oct 2007
    Location
    Chennai, India
    Beans
    3,786
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: how to give a user sudo privilege from command line?

    Quote Originally Posted by highspider View Post
    Code:
    gedit /etc/sudoers
    DON'T do this! It's an almost surefire way to break your sudo. This approach is not recommended:

    a) It doesn't do anything to clear your problem
    b) editing /etc/sudoers without using the "visudo" command is highly NOT recommended
    c) gedit does not come with KDE (KDE's default editor is KATE)
    d) to use a custom editor to edit the sudoers file, use
    Code:
    EDITOR=/usr/bin/gedit visudo
    All in all, the above advice is useless at best and dangerous otherwise.

    To get back to your problem, what is actually happening with the desktop is "bombing out"?
    Last edited by prshah; March 14th, 2011 at 10:17 AM.
    Cheers,PRShah
    Make your own: Ubuntu, Kubuntu, Xubuntu, Mythbuntu All-in-One Live DVD
    "I never make mistakes; I thought I did, once.. but I was wrong."

  6. #6
    Join Date
    Mar 2006
    Location
    South Africa, Secunda
    Beans
    137
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to give a user sudo privilege from command line?

    The system startsup to the point where you have to supply login credentials to get into KDE. I enter my username and password. It starts to load the desktop but then goes back to the login screen.

    Just before it started doing this I playes around with the 3D desktop settings in the system manager. If I recall correctly there was a tick box to disable opengl compatibility checks. I selected that and since then I could not log back into that account via KDE. The new user I made loads KDE perfectly but he cannot see the home dir of the old user...

  7. #7
    Join Date
    Oct 2007
    Location
    Chennai, India
    Beans
    3,786
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: how to give a user sudo privilege from command line?

    Quote Originally Posted by georgelappies View Post
    startsup to the point where you have to supply login credentials

    the 3D desktop settings in the system manager.
    At the login screen, you will find two buttons at the bottom left of the login window (changes depending on your theme). One will be a "power off" style red button, and one will be a blue "down arrow" graphic button. Click the blue button, and choose "Failsafe". Now you should be able to log in as your original user.

    Navigate to the 3D settings (System settings-desktop-advanced) and change it back to the original. Then log out and log back in normally, and everything should be fine.

    Please post back with results / errors.
    Last edited by prshah; March 14th, 2011 at 12:02 PM.
    Cheers,PRShah
    Make your own: Ubuntu, Kubuntu, Xubuntu, Mythbuntu All-in-One Live DVD
    "I never make mistakes; I thought I did, once.. but I was wrong."

  8. #8
    Join Date
    Mar 2006
    Location
    South Africa, Secunda
    Beans
    137
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to give a user sudo privilege from command line?

    Quote Originally Posted by prshah View Post
    At the login screen, you will find two buttons at the bottom left of the login window (changes depending on your theme). One will be a "power off" style red button, and one will be a blue "down arrow" graphic button. Click the blue button, and choose "Failsafe". Now you should be able to log in as your original user.
    Hi, thanks for your assistance. When I choose failsafe the exact same happens for that user, the new user can login with failsafe without a problem. Weird...

  9. #9
    Join Date
    Oct 2007
    Location
    Chennai, India
    Beans
    3,786
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: how to give a user sudo privilege from command line?

    Quote Originally Posted by georgelappies View Post
    When I choose failsafe the exact same happens
    OK, here's something else you can try:

    At the login screen, switch to a virtual terminal with Ctrl+Alt+F1. Log in as the original user, unlock your home directory when prompted.

    Now give these commands
    Code:
    locate kwinrc
    mv ~/.kde/kwinrc ~/kwinrc_backup
    mv .compiz dot_compiz
    This will remove Kwin and Compiz settings. The first command will give you the location of kwinrc. Please replace this in the second command, instead of the part in red. Depending on whether you used KWin or Compiz, one or the other command may give you an error, which you can ignore (for now).

    Now, restart KDE
    Code:
    sudo service kdm restart
    and attempt to log in again (Press Ctrl+Alt+F7..F10 if the login window does not appear).

    Please post back with results / errors.
    Cheers,PRShah
    Make your own: Ubuntu, Kubuntu, Xubuntu, Mythbuntu All-in-One Live DVD
    "I never make mistakes; I thought I did, once.. but I was wrong."

  10. #10
    Join Date
    Mar 2006
    Location
    South Africa, Secunda
    Beans
    137
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to give a user sudo privilege from command line?

    Thanks!!! Problem is solved

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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