Operating System - Linux
1827862 Members
1668 Online
109969 Solutions
New Discussion

Perl: Invoke skript under differrent user?

 
SOLVED
Go to solution
Kalin Evtimov
Regular Advisor

Perl: Invoke skript under differrent user?

Hi!

I have a question: Can I invoke a perl script under different user?
For example: I am root,I have to run a script under usr test and it should be invoked by a script, that runs under root. How can I do that? Is it possible?

Thanks for helping!
3 REPLIES 3
Tomek Gryszkiewicz
Trusted Contributor
Solution

Re: Perl: Invoke skript under differrent user?

Steven E. Protter
Exalted Contributor

Re: Perl: Invoke skript under differrent user?

Shalom Katin,

There are two ways to grant access to a root script to users. One is suid permissions, but this makes it available to all users.

The second way is sudo, which allows you to decide what users can use it. Its important that you reveiw the perl code and see that its safe.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kalin Evtimov
Regular Advisor

Re: Perl: Invoke skript under differrent user?

Thank you, sudo worked perfecltly!