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

I am in a situation where I have to chose between unix user groups or sudo to tackle an issue.

To give some background, A Linux app is installed as user X. The installation copies some scripts and creates certain log directories with execute/write permissions for user X.

Now another app with user Y needs to start X. It needs to run app as user Y. And it should be able to execute the launch script and write to log files which are permissioned for user X.

To solve this, I have 2 solutions in mind:

  1. Run the app as user Y using sudo/su. This means, I need to put the password in the launch script which may not be okay with compliance. We can give a read only permission to the launch script but still.

  2. Add user Y and X to a group and give them the correct group permissions to get this done

I personally think 2 is better and is more flexible and be free of putting the password into launch script which could be an issue on the production system.

Please let me know your thoughts and if you have any better ideas to do this.

share|improve this question
Why not just install the app globally as is tradition? – Garrett Nov 14 '11 at 23:50

sudo is meant as a replacement to switching users (by giving privilege elevation only when needed), and su switches users - neither of which is really necessary here. Unless you really needed root, using groups and file system level permissions is a better option - it would be somewhat simpler, and safer.

share|improve this answer
sudo is not for root specifically; it's just like su in that it can run commands as any user equally. – grawity Nov 15 '11 at 0:34

You must log in to answer this question.

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