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: Extend SWAP size by adding a new Logical Volume
Viewed 1163 times since Sat, Jun 2, 2018
Extending Linux LVM partitions - scripts
Viewed 4589 times since Sun, May 20, 2018
ZFS: Snapshots and clones on zfs filesystems
Viewed 2045 times since Sun, Jun 3, 2018
logrotate - rotates, compresses, and mails system logs.
Viewed 906 times since Fri, Nov 30, 2018
Linux - How to perform I/O performance test with dd command
Viewed 4803 times since Fri, Jun 8, 2018
Manage SSH Key File With Passphrase
Viewed 1243 times since Tue, Mar 5, 2019
RHEL: Change system’s hostname
Viewed 2011 times since Sun, May 27, 2018
RHEL: Reserved space on a ext2/ext3/ext4 filesystem
Viewed 3079 times since Sun, May 27, 2018
how to list all hard disks in linux from command line
Viewed 1257 times since Mon, Jan 28, 2019
Tip: SSD and Linux. Enable TRIM and check if it works
Viewed 2425 times since Fri, May 15, 2020