LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 06-16-2007, 11:27 AM   #1
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 457

Rep: Reputation: 30
Understanding sudo


I have myself and my kids set up on my laptop. When I was logged in as one of my kids I needed to configure the wireless connection as it was not working when I logged in as her. I tried to go into admin mode in the KDE System Settings. When it would ask for the password I typed in mine and it would not except it. I opened a terminal and su to me and tried again, I just got an su error dialog popup. Can I set up my kids accounts to be able to use MY password for admin tasks? I do not want them to be able to use theirs, but I would like to use mine if I am logged in as them if need be.

Thanks,
Todd
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 06-16-2007, 12:19 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
If you hit [ctrl]+[alt]+[F1-6] from X you can open a console and sign in as yourself, and [alt]+[F7] to get back into X. What admin tasks do you need to perform? I don't think there is any safe way to make it "easy" for them to use your account. You can't "setuid" a script, and it would be unsafe to have a "setuid" program that doesn't perform verification.
ta0kira
 
Old 06-16-2007, 01:09 PM   #3
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 457

Original Poster
Rep: Reputation: 30
For some reason the wireless NIC was not enabled when I logged into my daughter's account. I needed root privileges to do this and I could not figure out how to get them. I am not quite getting the sudo thing. I would like to just type in the 'root' password when logged in as whomever to do admin type work. Guess I need to figure this out

Thanks,
Todd
 
Old 06-16-2007, 02:46 PM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
Using sudo means that you don't need to know the root password. Sudo allows you to act as admin using your own account and password.

If you wish to perform an admin task while logged in as your daughter, do
Code:
sudo <the command>
<your daughter's password>
and you will be able to do whatever. If you are logged in as you, put in your own password, of course.

Lastly, check out
Code:
man sudo
 
Old 06-16-2007, 06:38 PM   #5
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 457

Original Poster
Rep: Reputation: 30
I realize that I can put my daughter in the sudoers file and then they can perform root type commands by using their password; however, I do not want to give my 11 year old admin access (for obvious reasons). Sometimes the need pops up when I need to do an admin task when my daughter is logged in and as I do not want to give her root access I was wondering if I could somehow set it up to allow her account root access but only if she uses my password (which she does not know). That way I can do admin tasks while she is logged in. Is this even possible? Does it even make sense?

Thanks
 
Old 06-18-2007, 11:40 AM   #6
Hobbletoe
Member
 
Registered: Sep 2004
Location: Dayton, Oh
Distribution: Linux Mint 10, Linux Mint 11
Posts: 148

Rep: Reputation: 18
Please note that I do not know very much about sudo, but I am fairly certain that you can enable certain commands. Can't you identify what administrative tasks would be needed while in your daughter's account, and just add those commands to sudo, such as enabling your wireless card? It would allow her to start the card without giving her access to the entire system.
 
Old 06-18-2007, 03:02 PM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
Why not simply enable the root account?
sudo passwd root

Then you can use su to become root--just like any normal distro.

The ONLY flaw in Ubuntu--root disabled by default
 
Old 11-26-2012, 09:49 PM   #8
BriteLeaf
LQ Newbie
 
Registered: Nov 2012
Posts: 3

Rep: Reputation: Disabled
Quote:
Originally Posted by leupi View Post
I have myself and my kids set up on my laptop. When I was logged in as one of my kids I needed to configure the wireless connection as it was not working when I logged in as her. I tried to go into admin mode in the KDE System Settings. When it would ask for the password I typed in mine and it would not except it. I opened a terminal and su to me and tried again, I just got an su error dialog popup. Can I set up my kids accounts to be able to use MY password for admin tasks? I do not want them to be able to use theirs, but I would like to use mine if I am logged in as them if need be.

Thanks,
Todd
I have been having a problem similar to this, only when I type sudo <cmd> (i.e sudo apt-get install yada) it asks for my user (not root) password. When I type that in, it tells me "yada is not in the sudoers file. This incident will be reported." My question is, HOW do I put yada in the sudoers file?
 
Old 11-26-2012, 10:42 PM   #9
yancek
Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 5,077

Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
Generally on most distributions using sudo, the first user created during installation will have sudo rights. You can add other users to the sudoers list by editing the list. Instructions at the site below as well as numerous other sites.

http://www.pendrivelinux.com/how-to-...-sudoers-list/

The problem you are going to have is that you will need to edit the file with root privileges so you will need the password for a user that has sudo privileges. Do you have other users? You should be able to do it from a Live CD.[COLOR="Silver"]

Last edited by yancek; 11-26-2012 at 10:43 PM.
 
Old 11-27-2012, 09:34 AM   #10
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 3,921

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
Quote:
Originally Posted by BriteLeaf View Post
I have been having a problem similar to this, only when I type sudo <cmd> (i.e sudo apt-get install yada) it asks for my user (not root) password. When I type that in, it tells me "yada is not in the sudoers file. This incident will be reported." My question is, HOW do I put yada in the sudoers file?
Highly recommend to read here:

https://help.ubuntu.com/community/RootSudo

Code:
In the terminal (for Precise Pangolin, 12.04), this would be:

sudo adduser <username> sudo

where you replace <username> with the name of the user (without the <>).
 
Old 11-27-2012, 11:29 PM   #11
BriteLeaf
LQ Newbie
 
Registered: Nov 2012
Posts: 3

Rep: Reputation: Disabled
Quote:
Originally Posted by snowpine View Post
Highly recommend to read here:

https://help.ubuntu.com/community/RootSudo

Code:
In the terminal (for Precise Pangolin, 12.04), this would be:

sudo adduser <username> sudo

where you replace <username> with the name of the user (without the <>).
I know you are NOT going to believe this, but I went to the main account, used the sudo adduser <username> sudo command, I got CONFIRMATION that <username> had indeed been added, then went back to my user, tried to sudo, and got the same error.

I tried both username's password, and root password. Root password says not user's password. User's password says "<username> is not in the sudoers file. This incident will be reported."

Strangely enough, if I go to the Main User and try to auth as root, I even get the Auth Failed error, and I KNOW I am using the correct password there.

Anyway, thank you for trying to help me in this matter.

Oh, btw, I am using Precise Pangolin, 12.04 LTS
 
Old 11-28-2012, 02:57 AM   #12
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 287Reputation: 287Reputation: 287
Quote:
Originally Posted by BriteLeaf View Post
I know you are NOT going to believe this, but I went to the main account, used the sudo adduser <username> sudo command, I got CONFIRMATION that <username> had indeed been added, then went back to my user, tried to sudo, and got the same error.

I tried both username's password, and root password. Root password says not user's password. User's password says "<username> is not in the sudoers file. This incident will be reported." ...
Do you mean that nobody can use sudo now? Does this include you as well??
If so, then see this to fix a broken sudo: http://www.psychocats.net/ubuntu/fixsudo

You may be able to use the Case 1A listed there to add your daughter to the sudo file.
The Case 1B listed there should be able to fix your ability to sudo if that is broken.
 
Old 11-28-2012, 08:11 AM   #13
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 3,921

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
I don't understand what you mean by "root password." There is no root password in Ubuntu; the root account is locked.

tommcd's link is highly recommended: http://www.psychocats.net/ubuntu/fixsudo
 
Old 11-28-2012, 08:45 AM   #14
dgodbey
LQ Newbie
 
Registered: Jan 2006
Location: Bel Air MD
Distribution: Fedora
Posts: 16

Rep: Reputation: 1
I manage several Fedora 16 boxes that is used by several software developers. The developers need to restart particular servers, apache, tomcat, and jboss, fairly frequently. So what I so is have group setup in sudoers file that can run the set of commands needed by the developer, and only that set of commands. Any user who belongs to that group can restart the servers. This way I give folks just enough admin rights to get their job done and not enough to screw up the server environment.
 
Old 11-29-2012, 12:57 AM   #15
JimKyle
Member
 
Registered: Dec 2001
Location: Oklahoma City, OK, USA
Distribution: Xubuntu 12.04 LTS
Posts: 156

Rep: Reputation: 18
Quote:
Originally Posted by BriteLeaf View Post
I know you are NOT going to believe this, but I went to the main account, used the sudo adduser <username> sudo command, I got CONFIRMATION that <username> had indeed been added, then went back to my user, tried to sudo, and got the same error.

I tried both username's password, and root password. Root password says not user's password. User's password says "<username> is not in the sudoers file. This incident will be reported."

Strangely enough, if I go to the Main User and try to auth as root, I even get the Auth Failed error, and I KNOW I am using the correct password there.

Anyway, thank you for trying to help me in this matter.

Oh, btw, I am using Precise Pangolin, 12.04 LTS
Did you log out as <username> and then log back in, after adding the group and before trying sudo? The list of sudoers in RAM is only updated at login time, so changes made in a session won't take effect until after the next login.
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Ultimate Sudo FAQ To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 02:36 AM
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 04:20 PM
Sudo without having to type "sudo?" Mitch G Linux - Security 3 09-28-2006 03:16 PM
help understanding ln dr_zayus69 Linux - General 3 01-14-2005 09:33 PM
Understanding df -k itsjustme Linux - General 6 10-28-2003 01:08 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration