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
ubuntu How to Reset Forgotten Passwords in Ubuntu 16.04
Viewed 3734 times since Tue, Dec 8, 2020
Linux – How to check the exit status of several piped commands
Viewed 3153 times since Wed, Jul 25, 2018
10 nmap Commands Every Sysadmin Should Know
Viewed 10195 times since Wed, May 22, 2019
Używanie rsync poprzez Secure Shell
Viewed 41496 times since Thu, May 24, 2018
How do I add ethtool settings to a network device permanently?
Viewed 6932 times since Mon, May 21, 2018
RHEL: Extending the maximum inode count on a ext2/ext3/ext4 filesystem
Viewed 3514 times since Sun, May 27, 2018
Logrotate Example for Custom Logs
Viewed 2789 times since Sun, Jan 12, 2020
LUKS dm-crypt/Device encryption GUIDE
Viewed 2566 times since Fri, Jul 13, 2018
LVM basic
Viewed 2407 times since Sat, Jun 2, 2018
www.unixarena.com
Viewed 2626 times since Fri, Jul 27, 2018