Home » Useful » Executing a local script remotely via SSH

Executing a local script remotely via SSH

If Machine A is a Windows box, you can use Plink (part of PuTTY) with the -m parameter, and it will execute the local script on the remote server.

plink [email protected] -m local_script.sh

If Machine A is a Unix-based system, you can use:

# ssh [email protected] < local_script.sh

You shouldn’t have to copy the script to the remote server to run it.

Posted in Useful and tagged as , , ,

Leave a Reply

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

Time limit is exhausted. Please reload the CAPTCHA.