If I understood, you want to execute one script that is on other server via ssh? Right? If this is a case you need to login to server number two without password. This is easy.
First way: All you have to do is generate ssh keys (without password). Here is how you can do this. Second way (better): I am guessing that you do not have permissions to execute script on server number two. This is easily solved if you have access to second server. This is how you do it:
- Enter visudo
- Add this line at the end of file
apache ALL=(user) NOPASSWD: script_path
example
apache ALL=(clamav) NOPASSWD: /usr/bin/clamscan
In the brackets you enter user that have permission to execute your script. srcipt_path is in above example /usr/bin/clamscan.
- With curl from server one you open some file on server two (lts call it script.php)
- Edit script.php and add
$do = exec("some_script some_arguments")
and that is it.