LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 05-23-2007, 01:20 AM   #1
walidaly
Member
 
Registered: Mar 2007
Posts: 64

Rep: Reputation: 15
visudo question


how do I give permission to a user to run especial service scripts as /etc/init.d/scriptname doesn't work for that special script
I tried something like
www ALL = NOPASSWD: /sbin/service httpd,/etc/init.d/iptables
but that give a parse error!
 
Old 05-23-2007, 02:19 AM   #2
mmn357157
LQ Newbie
 
Registered: May 2007
Location: Bangalore
Distribution: RHEL
Posts: 20

Rep: Reputation: 0
Lightbulb

hi,

login as root
# visudo

(write something like this)

User_Alias MYUSERS = <user1>, <user2>, <user3>
(the users to whom you are giving special permissions)

Runas_Alias OP = root
(giving root users privilages, normally it will be there, optional, you can also put ALL)

Host_Alias SERVERS = master, mail
(allowed on these hosts only. optional, otherwise you can put ALL)

Cmnd_Alias MYSERVICES = /etc/init.d/<service script name>, <another script or binary>, <another one>
(note: the path to service scripts varies, redhat (/etc/rc.d/init.d) suse(/etc/init.d))

(add one more line)

MYUSERS SERVERS = (OP) NOPASSWD: MYSERVICES

(NOPASSWD: is optional, if you put, no passwd will be asked)

(write changes)
(more info: man sudoers)
______________________________________
mmn
 
Old 05-23-2007, 02:26 AM   #3
mmn357157
LQ Newbie
 
Registered: May 2007
Location: Bangalore
Distribution: RHEL
Posts: 20

Rep: Reputation: 0
one more,

start service like this..

(if you want to start httpd)

issue command /etc/init.d/httpd start

___________________________
mmn
 
Old 05-23-2007, 02:36 AM   #4
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 1,575

Rep: Reputation: 97
Quote:
Originally Posted by walidaly
I tried something like
www ALL = NOPASSWD: /sbin/service httpd,/etc/init.d/iptables
So do you want this to work for all users in the 'www' group?

Try this:

Code:
%www ALL= NOPASSWD: /etc/init.d/iptables
Failing that, what is the exact error you get?
 
Old 05-23-2007, 03:28 AM   #5
walidaly
Member
 
Registered: Mar 2007
Posts: 64

Original Poster
Rep: Reputation: 15
I'm trying to excute fcgi with server script, it doesn't run through /etc/init.d/scriptname -why! I never know- but it runs through /sbin/service scriptname restart-stop-start...trying to add /sbin/service scriptname in visudo creates parse error
 
Old 05-23-2007, 08:59 AM   #6
mmn357157
LQ Newbie
 
Registered: May 2007
Location: Bangalore
Distribution: RHEL
Posts: 20

Rep: Reputation: 0
please put here the exact command you issued and its console error output.

i think, then you will be get answered more quickly.

____________________________
mmn
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A visudo script? djsodom Linux - General 1 02-27-2007 07:53 AM
dont see visudo matrix13 Linux - General 1 02-27-2007 01:40 AM
visudo noonmid27 Linux - Newbie 8 02-23-2007 04:42 PM
Need help with visudo powadha Debian 2 12-19-2004 05:04 AM
visudo xviddivxoggmp3 Slackware 7 08-17-2004 08:19 PM


All times are GMT -5. The time now is 01:50 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
Open Source Consulting | Domain Registration