Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^5: Automating sudo actions

by cjb (Friar)
on Jan 25, 2011 at 09:27 UTC ( [id://884081]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Automating sudo actions
in thread Automating sudo actions

Is there any reason you don't just run the perl setuid root? (with -T perhaps?)

Replies are listed 'Best First'.
Re^6: Automating sudo actions
by MidLifeXis (Monsignor) on Jan 25, 2011 at 14:07 UTC

    I hope that you meant, at most, the perl script. Be aware, however, that even this is not the first (or often the best) hammer in your toolbox. If you actually meant the perl executable itself.....

    ... ick ick ick. If I then have access to your perl suid executable, I now have root on the box. If I am using your suid perl executable for anything else, that anything else is now running as root on the box.

    The concept of least privileges would use that tool (suid) for a very limited application, with a very tight environment - never for something as powerful as the perl interpreter itself.

    Now, will it even allow itself to run suid root? I don't know if perl will allow you to shoot yourself in the foot hand a loaded gun, pointed at your foot, with a hair trigger, around a room of drunks, telling them that it is unloaded, while applying electric shocks to the person holding the gun just to see them twitch or not.

    --MidLifeXis

      Yes, I meant the script. Sorry I wasn't being clear. I certainly wouldn't suggest it was a great idea, but the OP describes a very restricted environment where a password less sudo etc. might not be possible to setup.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-20 03:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found