in reply to Installing Net::SSH::Perl on OS X, or how to run commands remotely
"The best way" is to have a secured directory on each remote machine containing scripts which do each of your automated tasks. Then you set up a restricted shell so that the user that your password-free key logs in as can only run the scripts in that directory. If you need to use sudo, you read up on the NOPASSWD flag for the sudoers file.
Of course, you have to vet your scripts very carefully to make sure that they cannot be subverted ...
For extra credit, you can set things up so that a given ssh key can only run one of these scripts ... no command prompt at all. You need more keys, but they can each only do the thing they were meant for. I have used this method to quiesce databases as part of a backup cycle.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Installing Net::SSH::Perl on OS X, or how to run commands remotely
by pingme8705 (Acolyte) on Sep 29, 2005 at 06:06 UTC |