Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I run:

ps -e -o pid,user,group

I see that processes have users and groups (among other properties).

How can I as a user influence the group assignment to the processes that I start?

In other words, is something like this possible?

run_as_group mygroup myserver -port 1234

where run_as_group is some standard Unix utility that takes a name of a group and a command line and executes this command line under my user name and under the given group name.

The goal that I'm trying to achieve is that a selected group of people get the permission to kill the processes that I've started.

(I'm concretely interested in Ubuntu/Debian if that matters.)

share|improve this question

You can use the newgrp command to log in to an alternative group and then run the command in that group.

Alternatively you can change the group of the executable and make the executable "setgid" (e.g. with chmod g+s myserver). This obviously has an effect on anyone running myserver and requires you to have permissions over its directory entry, wherever that is.

share|improve this answer
You mean chmod g+s myserver? – Kaarel Jul 20 '12 at 10:15
@Kaarel: Oops, yes. – Charles Bailey Jul 20 '12 at 10:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .