SSH: Execute Remote Command or Script – Linux

to ROCK? Start a GUI (graphical) application on a remote Linux workstation over SSH! Read more →

Example

Execute the local script.sh on the remote server:

$ ssh root@192.168.1.1 'bash -s' < script.sh
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
HowTo: The Ultimate Logrotate Command Tutorial with 10 Examples
Viewed 5385 times since Fri, Nov 30, 2018
What UUIDs can do for you
Viewed 1853 times since Tue, Jul 17, 2018
Using Kerberos security with Server for NFS
Viewed 9845 times since Wed, Jun 27, 2018
How to deal with dmesg timestamps
Viewed 3573 times since Wed, Oct 3, 2018
SPRAWDZONA KONFIGURACJA RSYSLOG I LOGROTATE, JAKO ZEWNĘTRZNEGO SERWERA SYSLOG
Viewed 3897 times since Fri, Nov 30, 2018
How to remove CTRL-M (^M) characters from a file in Linux
Viewed 2688 times since Thu, Feb 7, 2019
Using renice and taskset to manage process priority and CPU affinity with Linux OEL 6.4
Viewed 3723 times since Mon, Feb 17, 2020
Easily Find Bugs In Shell Scripts With ShellCheck
Viewed 3394 times since Thu, Apr 18, 2019
12 Linux Rsync Options in Linux Explained
Viewed 12123 times since Wed, Oct 31, 2018
How to Migrate from RHEL 8 to CentOS 8
Viewed 3133 times since Fri, May 15, 2020