LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-16-2010, 06:33 AM   #1
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Fedora 14, Ubuntu , Slax 5.1.8, OpenSolaris, Centos 4.8
Posts: 296

Rep: Reputation: 30
Sudo problem - Run all commands with password except these


Hi,
Having a problem with sudo. I'm down as a user who can run all commands as root provided I enter my password. The relevant line from my /etc/sudoers file :

Code:
 user1 ALL=(ALL) ALL
There are several commands that I run quite frequently such as mount and fdisk but would like to avoid having to enter a password each time I use them. What would be the appropriate change to the sudoers file ?

UPDATE:

I neglected to scroll down to the bottom of the /etc/sudoers file where there was the line :
Code:
 %admin ALL=(ALL) ALL
and since user1 was a member of the admin group any predeeding lines were being overidden by this. Commenting out this line and adding

Code:
user1 ALL= NOPASSWD: /bin/mount, /sbin/fdisk
solved the problem.

Regards
C

Last edited by uncle-c; 02-16-2010 at 07:18 AM. Reason: updated with solution
 
Old 02-16-2010, 12:02 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Thanks for posting your solution! (And off the 0-reply list now.)
 
  


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
Creating a script that will log into root and enter password and then run commands. tananthulus Linux - Newbie 8 11-02-2009 06:37 PM
[SOLVED] Problem in executing multiple commands through password less sudo vysakh@gmail.com Linux - Server 6 08-04-2009 08:11 AM
Problem using sudo <commands> just a man Ubuntu 13 06-05-2009 12:13 PM
sudo: I can't get it to run multiple commands. example within... s2cuts Linux - General 3 03-05-2008 10:07 PM
sudo problem. Want permission to run a sbin program without a password inverted.gravity Linux - Software 11 03-21-2007 04:34 PM


All times are GMT -5. The time now is 04:07 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration