Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to start a process/daemon as a different user 1

Status
Not open for further replies.

LaylaNahar

Programmer
Oct 25, 2006
26
US
Hello,


If I am logged in as userA and I want to start process as userB (userB being something other than root) how do I do this?

(I'm setting up and troubleshooting smokeping. I got some help that says, "Make sure smokeping is running as or has permissions to /var/ as the user you want it to run at.")

This is my first time setting up a linux system. I have yet to make any changes to the sudoers file.

thank you

LN
 
Normally su "/path/to/command", however that will prompt you for a password if you are not root in the first place. Use su [red]-[/red] "/path/to/command" if the process depends on some environment configuration in that user's .profile or .bashrc or similar.

If you need it to be passwordless, you can set up a sudo rule. man sudoers to see how to set up the rules, jump down to the examples at the bottom for the plain English version. :)

Annihilannic.
 
Thank you Annihilannic. A nice concise answer, and it really helped me understand things better.

thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top