Solved

processs started by root but running as somebody else

Posted on 1998-07-13
1
236 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

719 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