Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 3
    This question is similar to: How to execute an arbitrary simple command over ssh without knowing the login shell of the remote user?. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented May 9 at 23:09
  • 1
    Also: unix.stackexchange.com/q/450020/70524. Search term of relevance: "quoting hell" Commented May 9 at 23:10
  • 1) Don't disable StrictHostKeyChecking; implement proper public key distribution instead. You are disabling an essential security feature of SSH. 2) For any nontrivial command, prefer to run a (shell, or maybe python!) script on the server. Passing complicated commands like that directly over SSH can work but is somewhat brittle for various reasons. Commented May 10 at 17:38