The stupid question is the question not asked | |
PerlMonks |
Linux su twiceby breezykatt (Acolyte) |
on Aug 09, 2016 at 19:44 UTC ( [id://1169431]=perlquestion: print w/replies, xml ) | Need Help?? |
breezykatt has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I am wondering if it is possible to switch users twice, run a command and then exit back to the logged in user? For example: system("sudo su"); system("su - newuser"); system("/path/to/file"); system("exit"); system("exit"); or system("sudo su; su - newuser; ./path/to/file; exit; exit;"); thanks
Back to
Seekers of Perl Wisdom
|
|