Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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