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
LVM: Reduce an existing Logical Volume / Filesystem
Viewed 4188 times since Sat, Jun 2, 2018
List usernames instead of uids with the ps command for long usernames
Viewed 3094 times since Wed, Jul 25, 2018
HowTo: Find Out Hard Disk Specs / Details on Linux
Viewed 4429 times since Mon, Jan 28, 2019
Create a Linux Swap File
Viewed 3661 times since Fri, Jun 8, 2018
Linux LVM recovery
Viewed 18745 times since Wed, Jan 23, 2019
logrotate How log rotation works with logrotate
Viewed 9799 times since Sun, Jan 12, 2020
Enabling or disabling a repository using Red Hat Subscription Management
Viewed 13065 times since Mon, Oct 29, 2018
LVM: Extend an existing Logical Volume / Filesystem
Viewed 3165 times since Sat, Jun 2, 2018
CentOS / RHEL : Configure yum automatic updates with yum-cron service
Viewed 4093 times since Fri, Oct 26, 2018
ZPOOL: Add a mirror to a concat zpool
Viewed 4505 times since Sun, Jun 3, 2018