How To Run Shell Script or Command On Remote With Ssh

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/run-shell-script-command-remote-ssh/
PINTEREST
PINTEREST
INSTAGRAM

I want to run my commands securely. Are there anyway for this? Yes there are a lot of options. But the most simple and secure way is running scripts or commands over ssh.

Run Scripts/Commands Resides Remotely

If the scripts or commands are on the remote system we can easily run them like below. We will run uname -a command in the remote system.

And this is another version to run command or script on remote system. We provide full path of the command. Keep in mind use double quotes prevent unexpected errors

Run Scripts Resides Locally

There is a problem what will be happen if the script is located in local system. Should we copy it to remote system and then run. May be it is solution but more convenient and easy way is echoing script to the remote bash session

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/run-shell-script-command-remote-ssh/
PINTEREST
PINTEREST
INSTAGRAM

Leave a Reply

Your email address will not be published.