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"
In reply to Re: Run only if it the request is originating from a specific machine
by hbm
in thread Run only if it the request is originating from a specific machine
by calsaint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |