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.

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

1 Answer 1

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

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.