Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: root-owned script needs to "shell out" to bash as a non-privileged user. How?

by choroba (Chancellor)
on Jan 16, 2013 at 16:28 UTC ( #1013611=note: print w/ replies, xml ) Need Help??


in reply to root-owned script needs to "shell out" to bash as a non-privileged user. How?

Instead of su, use sudo:
system '/usr/bin/sudo', '-u', $username, '/bin/bash', '-i';
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re: root-owned script needs to "shell out" to bash as a non-privileged user. How?
  • Download Code

Replies are listed 'Best First'.
Re^2: root-owned script needs to "shell out" to bash as a non-privileged user. How?
by mrfirmware (Initiate) on Jan 16, 2013 at 16:51 UTC
    Ok, color me embarrassed. That worked great. Thank you very much.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013611]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (11)
As of 2016-06-27 19:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (344 votes). Check out past polls.