in reply to Run only if it the request is originating from a specific machine
I'd look to restrict it within ssh, unix permissions, and sudo - not within the script itself.
One possibility: Create a new account on the local machine; make it the owner of the script; in its .ssh profile, allow connections only from the other server. Give the script owner-only permissions (700). Then from the remote host:
ssh oracle2@dbhost1 "/opt/oracle/runroot.pl"
Or maybe, create the new account as above; but make the script root-owned and 700; and via sudo, allow only the new account to run the script. Then, from the remote host:
ssh oracle2@dbhost1 "sudo /opt/oracle/runroot.pl"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Run only if it the request is originating from a specific machine
by calsaint (Initiate) on Aug 26, 2011 at 16:44 UTC | |
by hbm (Hermit) on Aug 26, 2011 at 17:56 UTC | |
by calsaint (Initiate) on Aug 29, 2011 at 20:59 UTC |