In this tutorial you will learn how to run remote command using SSH on Ubuntu Server.
Code used during this tutorial:
1 2 3 4 5 6 7 8 9 10 11 |
# Running a single command on a remote server ssh liviu@http.liviubalan.com "ls ~/" # Bash shell script vi ~/script.sh #!/bin/bash REMOTE=`ssh liviu@http.liviubalan.com "ls ~/"` echo $REMOTE # Execute bash script bash ~/script.sh |