Best way to run a shell with different user

Hi , we got autosys for scheduling our jobs. Autosys user logs in to the Linux box and need to execute a shell script. problem here is user requires admin privileges on database to complete the task. Since scheduling is maintained by different team I don't want autosys user to have admin privileges to database. Instead I want autosys to log into the box but run the script using different user. I don't want to give autosys team the password of the new user. So What is the best way to accomplish this task. Do I have to add first step to sudo to new user and give autosys user just execute privilege on this script so they can't know the password of DB user. or is there any better way to handle this situation.

Please provide example along with ur solution.

Advance Thanks to all

Sai

You can switch user by sudo or by ssh. The latter must deny interactive login e.g. by having the script as a login shell. Key is provided for password-less.
sudo can be used as well for non-interactive access (as autosys user); there is a NOPASSWD option in sudoers. For interactive login sudo is more convenient anyway.