LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 01-12-2006, 01:01 PM   #1
tracer
LQ Newbie
 
Registered: May 2002
Posts: 17

Rep: Reputation: 0
SUDO for user nobody


How would I setup the user "nobody" to be able to execute a command as another user named "userx"? I bascially need the nobody user (which owns httpd) to run a php-cli script as the user "userx" without having to enter any passwords.

I googled a little on this subject, but it mostly appears to granting limited root access to users....

I know i need to edit the sudoers file, but what should the entry look like?

If it makes a difference this is a RH 9 box...

thanks in advance
 
Old 01-12-2006, 01:23 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
su

Most often used without the username---in which case it defaults to root.

Look at "man su" for the details

You can also give your "nobody" user specific privileges
 
Old 01-12-2006, 01:48 PM   #3
silmaril8n
Member
 
Registered: May 2004
Location: Vancouver, WA
Distribution: Mint, Debian, Slackware
Posts: 123

Rep: Reputation: 15
The command is "sudo -u nobody [command] [file]"

The user that is running sudo (ie. you) needs to be in sudoer file, not the user that you want to execute the command under.

My sudoer file has: "[myusername] ALL=(ALL) ALL"

I just tested it out by editing a file with the user nobody. Stuck in my user password and voila!
 
Old 01-12-2006, 03:12 PM   #4
tracer
LQ Newbie
 
Registered: May 2002
Posts: 17

Original Poster
Rep: Reputation: 0
pixellany is on the right path - So editing my /etc/sudoers file should look something like

nobody ALL=(userx) /home/userx/myscript.php

But how do I ensure that no password is in place?
 
  


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
sudo wont allow user sh4d0w13 Linux - Newbie 2 08-17-2005 07:39 PM
SUDO - allow user joe to SU to usera sajjad02 Linux - Newbie 1 03-10-2005 02:25 PM
Sudo User Error ! LinuxRam Linux - Security 6 08-28-2004 11:03 PM
SUDO as *non-root* user spratty Linux - Newbie 3 05-19-2004 04:35 AM
track sudo user mikeshn Linux - General 2 10-28-2003 08:12 PM


All times are GMT -5. The time now is 12:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration