Skip to content
This repository has been archived by the owner on Jan 1, 2019. It is now read-only.

About SSH ProxyCommand supported. #39

Open
sizeoftank opened this issue Jul 19, 2016 · 3 comments
Open

About SSH ProxyCommand supported. #39

sizeoftank opened this issue Jul 19, 2016 · 3 comments

Comments

@sizeoftank
Copy link

Sometimes I want to using ssh Proxy Command to execute tasks on many servers.
Is there any plan to support this feature

@jeffpeiyt
Copy link
Contributor

Hi @sizeoftank

thanks for your interests in Parallec. Do you mean using proxy in ssh such as this example?

session.setProxy(new ProxyHTTP(proxy_host, proxy_port));

If yes, then it should not be hard by passing a set of parameters, would be super nice if you can fork and make a contribution similar to this pull request.

@sizeoftank
Copy link
Author

sizeoftank commented Jul 19, 2016

Hi, thanks for your response.
I think it is a bit difference between HTTP proxy
think about we want to execute df -h on target host 172.16.16.50 through a jump host 172.16.16.10 , a simple way is execute ssh 172.16.16.50 "df -h" on host 172.16.16.10 like that in parallec:

        pc.prepareSsh().setConcurrency(500)
                .setTargetHostsFromString("172.16.16.10")
                .setSshCommandLine("ssh 172.16.16.50 \"df -h; ds;\" ").setSshUserName(userName)
                .setSshPassword(passwd).setSshConnectionTimeoutMillis(5000)

And using ProxyComand is another way to this
It is just a configuration of ssh client ( like our setSshConnectionTimeoutMillis ), and if I using paramiko or ansible (python libraries) , they supported these.

So I suppose that we need to implement these configurations

        pc.prepareSsh().setConcurrency(500)
                .setTargetHostsFromString("172.16.16.50")
                .setSshCommandLine("df -h; ds; ").setSshUserName(userName)
                .setSshPassword(passwd).setSshConnectionTimeoutMillis(5000)
                .setProxyCommand("ssh root@172.16.16.10 -p 22 nc %h %p")
                .setIdentityFileForProxyCommand("keyfile")

I will fork your repository to do some trial :-)

@jeffpeiyt
Copy link
Contributor

@sizeoftank

Thanks for your clarification. If you are using jump host, probably could follow this example to enhance it.

As parallec uses Jsch, the features supported by Jsch would be easy to support by adding those parameters.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants