Run Local Scripts Remotely Over SSH in Linux


Run Local Bash Scripts Remotely


Run local bash script.sh over ssh, with sudo as root, using custom ssh key and sudo user.

ssh -i ~/.ssh/mykey sudouser@hostname "sudo bash -s" < script.sh

Run local bash script.sh over ssh, simplified version

ssh hostname < script.sh

Run Local Perl Scripts Remotely

Run local Perl perlscript.pl over ssh, quietly (-q)

ssh -q hostname "perl -" < perlscript.pl