Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2017-05-28 01:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?