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
logrotate Log Rotate Configuration
Viewed 4241 times since Sun, Jan 12, 2020
RHEL: Checking HBAs
Viewed 17052 times since Sun, May 27, 2018
VMWare tools free
Viewed 10384 times since Mon, Jul 16, 2018
Modifying the inode count for an ext2/ext3/ext4 file system
Viewed 18455 times since Fri, Sep 18, 2020
Fix rpmdb: Thread died in Berkeley DB library
Viewed 22359 times since Fri, Feb 14, 2020
Linux - How to get IP and MAC address of ethernet adapter in Linux
Viewed 3705 times since Fri, Jun 8, 2018
OpenSSL: Check If Private Key Matches SSL Certificate & CSR
Viewed 4247 times since Mon, Feb 18, 2019
Check Detailed CPU Information In Linux With CoreFreq [Advanced]
Viewed 3636 times since Thu, Apr 18, 2019
How to remove CTRL-M (^M) characters from a file in Linux
Viewed 3872 times since Thu, Feb 7, 2019
RHCS6: Basic operations on clustered services
Viewed 3770 times since Sun, Jun 3, 2018