2

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.)

1 Answer 1

1

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.

2
  • You mean chmod g+s myserver?
    – Kaarel
    Jul 20, 2012 at 10:15
  • @Kaarel: Oops, yes.
    – CB Bailey
    Jul 20, 2012 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.