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
haproxy linux
Viewed 3217 times since Sun, Dec 6, 2020
RHEL: Allowing users to ’su’ to "root" / Allowing ’root’ to login directly to the system using ’ssh’
Viewed 3772 times since Sat, Jun 2, 2018
YUM CRON Enabling automatic updates in Centos 7 and RHEL 7
Viewed 12760 times since Fri, Oct 26, 2018
zabbix linux How to solve apache error No space left on device: Cannot create SSLMutex
Viewed 3315 times since Wed, Nov 11, 2020
Increase A VMware Disk Size (VMDK) Formatted As Linux LVM without rebooting
Viewed 16828 times since Wed, May 30, 2018
How to remove CTRL-M (^M) characters from a file in Linux
Viewed 3551 times since Thu, Feb 7, 2019
stunnel: Authentication
Viewed 9883 times since Fri, Sep 28, 2018
logrotate How log rotation works with logrotate
Viewed 10004 times since Sun, Jan 12, 2020
watchdog How to restart a process out of crontab on a Linux/Unix
Viewed 7142 times since Tue, Jul 31, 2018
LVM: Create a new Logical Volume / Filesystem
Viewed 2807 times since Sat, Jun 2, 2018