LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 04-15-2007, 03:33 PM   #1
And3rew
LQ Newbie
 
Registered: Apr 2007
Posts: 4

Rep: Reputation: 0
Adding abilities for non-root users?


Hey, all --

I'm running Kubuntu Edgy Eft and have a simple question about root and non-root users.

I'm clear about not logging in as root, and about using sudo. No problem. What I'm wondering about is increasing the "power" of non-root users. I'm the only user of my system, and it's a little annoying to have to enter my password to make small changes (e.g., changing the time).

Is there any way I can choose what non-root users are allowed to do and not do? My install is new, so I'm making lots of tweaks and have to keep entering my password. Not a huge deal, but it would be nice to avoid that for certain things.

If there's a way to do that (or as a second option, to increase the password-cache time from 15 minutes), I'd love to know it.

Thanks much!
 
Old 04-15-2007, 04:13 PM   #2
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
You can make it such that all members of the 'admin' group can perform admin tasks without entering their password (still using sudo) by changing one line in /etc/sudoers. To edit this file, run 'sudo visudo' from a console and add NOPASSWD: to the %admin line, as in:
Code:
%admin ALL=(ALL) NOPASSWD: ALL
 
Old 04-15-2007, 04:14 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
if you edit /etc/sudoers you can change the entry for your normal user to have the NOPASSWD option, whic does exactly what it says on the tin. check the sudoers manpage for more details.
 
Old 04-15-2007, 04:24 PM   #4
theedisoneffect
LQ Newbie
 
Registered: Apr 2007
Location: BFE, Central FL
Posts: 22

Rep: Reputation: 15
Well, it's a bad idea to use the root account regularly, but that doesn't mean you shouldn't ever use it. Just login as root, set everything up, then go back to your normal account when you're done. You'll prolly still find a few tweaks to do, which can be done with sudo.

Other option is to, at least temporarily, remove the password requirement for sudo: choose whatever editor you like, open '/etc/sudoers'. You'll see your username, some spaces, and prolly 'ALL = ALL', Change that to 'ALL = NOPASSWD: ALL' then save the file.

I recommend changing it back when you're done with the tweaking, though.

Edit: Wow, I'm slow. Guess I shouldn't take a bathroom break in the middle of typing a post...

Last edited by theedisoneffect; 04-15-2007 at 04:26 PM.
 
Old 04-15-2007, 04:38 PM   #5
Black_Hand
LQ Newbie
 
Registered: Apr 2007
Distribution: SuSE 10.2
Posts: 1

Rep: Reputation: 0
Why is it a bad thing to use the root account? The root account is the only one i could get to install my sound drivers.
 
Old 04-15-2007, 04:47 PM   #6
theedisoneffect
LQ Newbie
 
Registered: Apr 2007
Location: BFE, Central FL
Posts: 22

Rep: Reputation: 15
Well, it's not a bad thing to use it... it's there for a reason. It's bad to make a habit of using it, because of security risks and the fact that you have full control to inadvertently screw something up while running as root.

Basically, use it when you need the administrative power, don't when you don't. And when you're configuring the system for the first time, or having trouble installing drivers, or whatever, well, then you need the administrative power.
 
Old 04-15-2007, 04:48 PM   #7
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Quote:
Originally Posted by theedisoneffect
Well, it's a bad idea to use the root account regularly, but that doesn't mean you shouldn't ever use it. Just login as root, set everything up, then go back to your normal account when you're done. You'll prolly still find a few tweaks to do, which can be done with sudo.

Other option is to, at least temporarily, remove the password requirement for sudo: choose whatever editor you like, open '/etc/sudoers'. You'll see your username, some spaces, and prolly 'ALL = ALL', Change that to 'ALL = NOPASSWD: ALL' then save the file.

I recommend changing it back when you're done with the tweaking, though.
It may be better to use NOPASSWORD for individual commands. Look at the mount example in the the sudoers file. Then the command to change the time could be run by members of a group without having to enter a password. Also look at the option to have sudoers enter there own password instead of the root password. This way you don't need to give out the root password. Some distro's preconfigure the sudoers file to do it that way normally.

Quote:
Originally Posted by Black_Hand
Why is it a bad thing to use the root account? The root account is the only one i could get to install my sound drivers.
If you have a number of commands to run as root to install your sound drivers, it would be fine to su to root and then install your drivers. Then exit and become a regular user again. This is still a lot safer then logging in as root.
 
  


Reply

Tags
login, root, sudo


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
Adding root privaliges to user accounts or auto login as root Val-Ent Linux - General 15 03-02-2010 04:27 PM
limiting linux users abilities MrSako Linux - General 5 08-18-2006 06:52 PM
group creation + adding users without root permission rblampain Programming 5 05-12-2006 07:55 PM
Adding Java to root users PATH? infornography Linux - Newbie 5 05-26-2005 07:49 AM
Allright, changed root password and questions about adding users RIOMX Linux - Newbie 2 10-30-2003 03:28 PM


All times are GMT -5. The time now is 09:28 PM.

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