Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-12-2006, 12:01 PM   #1
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, 12:23 PM   #2
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

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

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, 12:48 PM   #3
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, 02:12 PM   #4
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?


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

All times are GMT -5. The time now is 08:13 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration