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
Using grep to find string in files
Viewed 1617 times since Fri, May 15, 2020
Exclude multiple files and directories with rsync
Viewed 2032 times since Wed, Oct 31, 2018
Linux - How to get CPU information
Viewed 1723 times since Fri, Jun 8, 2018
20 IPtables Examples For New SysAdmins
Viewed 1879 times since Fri, May 15, 2020
Migrate a Linux System from Red Hat Enterprise to CentOS
Viewed 9913 times since Fri, May 15, 2020
Install Security Patches or Updates Automatically on CentOS and RHEL
Viewed 1507 times since Fri, Oct 26, 2018
How do I add ethtool settings to a network device permanently?
Viewed 6250 times since Mon, May 21, 2018
How to do a Filesystem Resize (ext3/ext4) on Redhat running on VMware
Viewed 10729 times since Wed, Jul 25, 2018
RHCS6: Quorum disk and heuristics
Viewed 3870 times since Sun, Jun 3, 2018
ZPOOL: Grow a zpool by adding new device(s)
Viewed 5798 times since Sun, Jun 3, 2018