in reply to Running Perl Script As a Different User

If the DB connection parameters (account/password) accessible to USERA involve permissions that should not be shared among the other users, the thing to do is to create a separate DB user account for the database / tables / columns in question, tailor the permissions for this new account to be appropriate for those other users (e.g. "select" only, or "select" and "update", or whatever), and provide a config file that they can access to use the connection parameters for this restricted DB account.

From what you've described, it sounds like a database access issue, not a login user account issue, so it should be solved via the database connection accounts with suitable granting of access within the DB, not by a shell-level setuid.

The point is that database user accounts and permissions are separate from shell / login accounts and permissions; a DBA manages the former, and a sysadmin manages the latter.

  • Comment on Re: Running Perl Script As a Different User