Unix User Group or Sudo/Su

2

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.

Medicine

Posted 2011-11-14T22:49:47.693

Reputation: 121

Why not just install the app globally as is tradition? – Garrett – 2011-11-14T23:50:19.170

Answers

3

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.

Journeyman Geek

Posted 2011-11-14T22:49:47.693

Reputation: 119 122

sudo is not for root specifically; it's just like su in that it can run commands as any user equally. – user1686 – 2011-11-15T00:34:55.230