Solved

processs started by root but running as somebody else

Posted on 1998-07-13
1
231 Views
Last Modified: 2010-04-20
How do you get a program to run under a different uid than the user that
started the program?

For example:  httpd on my computer is owned by root ; however, it
shows up in the process table as running under user "nobody".

I want to start a program during boot time and have it show up in the
process table with a user's uid instead of root's.
0
Comment
Question by:mag062397
1 Comment
 
LVL 2

Accepted Solution

by:
mlev earned 50 total points
Comment Utility
If you want to start an existing program under another user, you can do that with "su <user> -c <program>"
If you do "su - <user> -c <program>", it will also get the user's default environment, run in their home dir etc.

If you are writing a program of your own that you'd like to change uid, it can be achieved with the setuid system call.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now