Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13951

plumbum fails to connect via jump host, but raw command succeeds

$
0
0

I'm trying to SSH into final_machine via the jump host portal_machine. Both remote machines are Linux, local is Windows. When I run the following command in a cmd, I can successfully connect

ssh {username}@{final_machine} -oProxyCommand="ssh -W {final_machine}:22 {username}@{portal_machine}"

And I can also successfully connect through python with

ssh_command = plumbum.local["ssh"][f"{username}@{final_machine}", "-o", f"ProxyCommand=ssh -W {final_machine}:22 {username}@{portal_machine}"]ssh_command()

However, I need to connect via an SshMachine object for compatibility, and when I try the following, it fails

plumbum.SshMachine(final_machine, user=username,        ssh_opts=[fr'-o ProxyCommand="ssh -W {final_machine}:22 {username}@{portal_machine}"'])

with error

Return code:  | NoneCommand line: | 'true 'Host:         | {final machine}Stderr:       | CreateProcessW failed error:2

I've tried replacing ssh with C:\Windows\System32\OpenSSH\ssh.exe, but no change. I have SSH keys set up from my machine to portal_machine, my machine to final_machine, and portal_machine to final_machine. Any other suggestions for how to debug would be appreciated. When I connect simply to the portal machine, it works fine.


Viewing all articles
Browse latest Browse all 13951

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>