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
How setting the TZ environment variable avoids thousands of system calls
Viewed 1829 times since Mon, May 21, 2018
RHCS6: Quorum disk and heuristics
Viewed 1831 times since Sun, Jun 3, 2018
RHEL: udev rules basics
Viewed 1708 times since Sat, Jun 2, 2018
RHEL : How to deal with “CLOSE_WAIT” and “TIME_WAIT” connection
Viewed 10703 times since Thu, Feb 14, 2019
Top 25 Best Linux Performance Monitoring and Debugging Tools
Viewed 3709 times since Sun, Sep 30, 2018
linux ssh How to Hide the OpenSSH Version Details when Telnet to Port 22
Viewed 916 times since Wed, Apr 22, 2020
Używanie rsync poprzez Secure Shell
Viewed 37515 times since Thu, May 24, 2018
HP-UX - Stunnel Configuration
Viewed 754 times since Fri, Sep 28, 2018
stunnel Howto A Guide to create SSL access to a HTTP-only webserver with stunnel
Viewed 836 times since Fri, Sep 28, 2018
RHCS6: Debug and test multicast traffic between two hosts
Viewed 1089 times since Sun, Jun 3, 2018