-
-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execute the scripts over ssh connection #162
Comments
What about something like this: script.Exec("ssh myhost ls").Stdout() |
thanks for your reply, is this work for executing sub commands on that ssh connection using builder pattern? script.Exec("ssh yhost ls").FIle("filepath").Stdout() will this work? |
We can execute commands remotely using |
@bitfield script.Context("ssh").ssh("ssh connection here").DoSomeWorkOnRemoteServer().Context("local").doSomeWorkLocally() |
Well, how could we do any work on the remote server? Only by executing code there. How can we get the code on to the remote server? We'd have to deploy a binary there. If we can do that, why bother with SSH? Now we can just do the work locally. |
@bitfield |
Yeah I have similar use case I am using script with nats nats is the Transport , instead of ssh. The binary ( that imports script ) needs to exist on both sides though ! I was thinking of add NATS as a formal transport provider to Script as a PR but my use case / prototype has not stabilised yet. nats can stream anything. The data and ops are just topics in the same way that file paths are namespaces. It’s pretty nice you can add nats AAA security too so that only certain user roles can run over certain topics and so certain file paths on the server. hit me up if your curious for more info |
So basically, something that allows you to do it like this https://www.fabfile.org/
|
I think we pretty much have this already, don't we? We can do something like: script.File("hosts.txt").ExecForEach("ssh {{.}} ls").Stdout() If we agree that deploying binaries to the remote hosts is out of bounds, but running plain shell commands and getting the output is okay, then yes, I think this is done. |
I found the library is great and covers most of bash scripting, but you know most of the time when you do bash scripting, you do it on remote servers so how can I make the scripts that I write using this library to be executed over ssh, is there something like this for example?
thank you
The text was updated successfully, but these errors were encountered: