Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Sudo Help
nuthead
post Jun 23 2004, 03:08 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 4
Joined: 23-June 04
Member No.: 3,211



Hi,
I have just purchased a Linux box for my web hosting business and need to run one command with extended permissions. The perfect way to do this seemed to be with Sudo but I've run in to some difficulty. I've been testing with a local account set up on the server and I'm connecting through SSH. Below is my sudoers file and the command im running:

CODE
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

# Cmnd alias specification
Cmnd_Alias CRUTILS = /usr/local/psa/bin

# Defaults specification

# User privilege specification
root    ALL=(ALL) ALL
james   ALL=NOPASSWD: CRUTILS

# Uncomment to allow people in group wheel to run all commands
# %wheel        ALL=(ALL)       ALL


CODE
sudo /usr/local/psa/bin/client.sh

I first of all get prompted for a password (i thought NOPASSWD was meant to stop this prompt) and then i get the error
CODE
Sorry, user james is not allowed to execute '/usr/local/psa/bin/client.sh' as root on xxxx.

if i do a sudo -l i get:
CODE
User james may run the following commands on this host:
   (root) NOPASSWD: /usr/local/psa/bin


I don't think I've missed anything here! Any help will be greatly appreciated.
Go to the top of the page
 
+Quote Post
nifflerX
post Jun 23 2004, 03:23 PM
Post #2


./configure
***

Group: Members
Posts: 76
Joined: 4-November 03
Member No.: 1,751



I am not positive about this, but you might need this line:

CODE
james   ALL=(ALL)         NOPASSWD: CRUTILS


instead of:

CODE
james   ALL=NOPASSWD: CRUTILS


HTH.


-NifflerX
Go to the top of the page
 
+Quote Post
nuthead
post Jun 23 2004, 03:24 PM
Post #3


Whats this Lie-nix Thing?
*

Group: Members
Posts: 4
Joined: 23-June 04
Member No.: 3,211



i tried that too sad.gif
Go to the top of the page
 
+Quote Post
nuthead
post Jun 24 2004, 03:19 PM
Post #4


Whats this Lie-nix Thing?
*

Group: Members
Posts: 4
Joined: 23-June 04
Member No.: 3,211



anyone else?
Go to the top of the page
 
+Quote Post
hughesjr
post Jun 24 2004, 08:05 PM
Post #5


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



You didn't say which linux disto ... my advise is with Sudo version 1.6.7p5 on a RHEL box....

try this for sudoers:
QUOTE
james  machine_name = NOPASSWD: /usr/local/psa/bin/client.sh


Replace the machine_name with the result of the command hostname

Also ... you might need to do any items the script /usr/local/psa/bin/client.sh that has to be run as root. Let's say it runs /usr/sbin/useradd and /usr/bin/passwd (in root mode) ... so we might need this as the sudoers file:

QUOTE
james  machine_name = NOPASSWD: /usr/local/psa/bin/client.sh, /usr/sbin/useradd, /usr/bin/passwd


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
nuthead
post Jun 25 2004, 02:23 AM
Post #6


Whats this Lie-nix Thing?
*

Group: Members
Posts: 4
Joined: 23-June 04
Member No.: 3,211



ok, i'll give them a go.Thanks!

by the way it is rhel3 with Sudo 1.6.7p5
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th October 2017 - 07:12 PM