Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by choroba (Cardinal)
on Jan 16, 2013 at 16:28 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1013611]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-24 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found