Skip to content

Latest commit

 

History

History
11 lines (7 loc) · 455 Bytes

File metadata and controls

11 lines (7 loc) · 455 Bytes

Run A Local Script On Remote SSH Server

Typically on SSH connection, we run commands on the remote server, but in order to run a local script on the remote server we can use bash -s which expects input from standard input, and runs the script in shell session.

Example

ssh user@remotehost 'bash -s' < script.sh

Source: Cloudsavvyit