Results 1 to 10 of 13

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

Hybrid View

  1. #1
    Join Date
    Mar 2006
    Location
    South Africa, Secunda
    Beans
    131
    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,803
    Distro
    Ubuntu Development Release

    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
    131
    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
    151
    Distro
    Ubuntu 14.04 Trusty Tahr

    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,803
    Distro
    Ubuntu Development Release

    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
    131
    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
    Dec 2010
    Location
    Earth
    Beans
    151
    Distro
    Ubuntu 14.04 Trusty Tahr

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

    Quote Originally Posted by prshah View Post
    DON'T do this!
    ....
    All in all, the above advice is useless at best and dangerous otherwise.
    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?
    Sorry missed the KDE part . I use Gnome....

    But prshah was better with just TTY1 ...
    Didn't mean no harm.

    sudoers info that isn't useless or too dangers
    http://ubuntuforums.org/showthread.php?t=1132821
    Last edited by highspider; March 17th, 2011 at 06:49 AM.
    In a perfect world my college professors would allow assignment as .odt openoffice.org files! And code as Eclipse projects.

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
  •