Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2016-07-26 01:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (230 votes). Check out past polls.