php: execute remote ssh script

 

$command = "sudo ssh -p 22 root@XXX.XXX.XX.XX python3 /home/scripts/apps/xxx/xxx/email_address/email_builder.py";
shell_exec($command);

note the you have to configure both server to be able to communicate via ssh (creating the key on the first one, uploading the pub key to the other, etc.)

Leave a Reply

Your email address will not be published. Required fields are marked *