Solved

processs started by root but running as somebody else

Posted on 1998-07-13
1
235 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
ID: 1637531
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

696 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