LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-20-2010, 01:12 AM   #1
tara
Member
 
Registered: Aug 2005
Location: Australia
Distribution: Centos 7
Posts: 58

Rep: Reputation: 15
Question sudo for a single command with no password entry


Hi,

I wish to allow a user to use sudo to run a single command (service app status) to determine if my application app is running, in my sudoers file i have:

user ALL= /sbin/service app status


I understand that there is a parameter called timestamp_timeout that will set the timeout for the 'user', but requires at least 1 entry of the root password.

I wish to allow the user to do "sudo service app status" and not have to enter the root password ever(maybe once is ok), but still make the user enter the root password for all other root activities. Is there a way to prevent the password entry for this command only and no others??

Thanks in advance.
 
Old 04-20-2010, 03:25 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by tara View Post
Hi,

I wish to allow a user to use sudo to run a single command (service app status) to determine if my application app is running, in my sudoers file i have:

user ALL= /sbin/service app status


I understand that there is a parameter called timestamp_timeout that will set the timeout for the 'user', but requires at least 1 entry of the root password.

I wish to allow the user to do "sudo service app status" and not have to enter the root password ever(maybe once is ok), but still make the user enter the root password for all other root activities. Is there a way to prevent the password entry for this command only and no others??

Thanks in advance.


actually what i posted before is correct...


Code:
# Cmnd alias specification
Cmnd_Alias SVSTAT = /usr/local/bin/svstat

# User privilege specification
nagios  ALL=SVSTAT, NOPASSWD: SVSTAT

example above says that the user called nagios can run the /usr/local/bin/svstat command without needing to enter a password.

Last edited by centosboy; 04-20-2010 at 03:29 AM.
 
Old 04-20-2010, 06:06 PM   #3
tara
Member
 
Registered: Aug 2005
Location: Australia
Distribution: Centos 7
Posts: 58

Original Poster
Rep: Reputation: 15
Thanks that's great, worked a treat!!
 
Old 04-21-2010, 02:58 AM   #4
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by tara View Post
Thanks that's great, worked a treat!!
Hi.

Please mark the thread as solved using the thread tools link


thanks
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sudo mkinitrd -o /boot/initrd.img-2.6.32.9 2.6.32.9 sudo: mkinitrd: command not foun vishwas181 Linux - Newbie 1 02-27-2010 01:16 AM
Creating user with password in single command karipineni_18 Linux - General 3 01-16-2010 05:16 AM
my sudo password is not the root password newbiesforever Linux - General 7 01-02-2010 09:59 PM
type sudo command then i cant type in a password turoblaztr Linux - General 5 01-14-2007 09:58 AM
Getting password expiry for all accounts in a single command jdc2048 Linux - Security 2 05-26-2004 08:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:32 PM.

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
Open Source Consulting | Domain Registration