switch user from local user to root in perl

Hi Gurus,

I have a script that requires me to switch from local user to root. Anyone who has an idea on this since when i switch user to root it requires me to input root password.

It seems that i need to use expect module here, but i don't know how to create the object for this.

Appreciate much your input on this...

try running the script as setuid - chmod the script 4755. This will NOT work well on Linux

see for syntax:
Perl setuid - FreeBSDwiki

1 Like