1753461 Members
4707 Online
108794 Solutions
New Discussion юеВ

Switch user

 
SOLVED
Go to solution
Ashwani Kashyap
Honored Contributor

Switch user

Hi all,

I am trying to write a korn shell script where in a user(not the root user) su's to another user, runs a batch job and then exits.

How can I accomplish this without su prompting for a password? Is there a way to pass the password automatically to su because I do not want the user suing to another user to know its pasword.

Thanks for all your help.
Ash
2 REPLIES 2
Alex Glennie
Honored Contributor
Solution

Re: Switch user

Antoanetta Naghiu
Esteemed Contributor

Re: Switch user

Hi!
If you don?t have sudo configured, you can play with permission of the executable jobs that you like to run. You can set a secondary group for the user that need to execute the job, or/and set up the owner-id or set-group-id (?s? permission), see man chmod command for details.
Hope this helps.