Execute Commands On Remote Linux Systems Via SSH

4 Responses

  1. Harry says:

    Great write up.
    I run ssh [email protected] ‘bash -s’ < system_information.sh from windows terminal (cmd)and got message
    bash: bash -s: command not found.
    However , it worked when run from Gitbash.Do I need to run it from Gitbash and not run from Windows?
    Thanks

    • sk says:

      Hey, this guide is tested on Ubuntu and it should work on other Linux distributions as well. I don’t know about Windows. Sorry I couldn’t help.

  2. Cray XMP says:

    You omitted the quotes in
    $ ssh [email protected] uname -r && lsb_release -a
    The statement “ssh [email protected] uname -r” has a return value which is tested locally against zero by “&&” then the second statement is evaluated on the local machine only.
    The whole command in quotes will be processed remotely as intended.
    $ ssh [email protected] ‘uname -r && lsb_release -a’

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.