SSH proxy / socket #238
-
Hello, In netmiko, we can pass a socket to the Is there a way to do the same thing with Scrapli ? I found a Netmiko Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hey @afourmy If you are using system transport there is no socket (in scrapli at least) since we are just wrapping /bin/ssh -- that means you get all your normal openssh things "for free" -- including proxy jump/control persist/kex/cipher/etc. stuff. In this case you would just setup your normal proxy things in your ssh config file. If you are using asyncssh you should also just use the ssh config file as asyncssh picks up many ssh config file things including proxy jump. In the case of paramiko/ssh2, the short answer is "no" there is no way to pass a socket, but if you really want to you of course can (yay python flexibility!). You would need to simply make your own socket object and set it after creating your connection but before opening. You'd just need to make the object satisfy this classes interface (should really just be open/close/isalive -- so just a tiny tiny wrapper around normal socket). then set it like HTH! |
Beta Was this translation helpful? Give feedback.
Hey @afourmy
If you are using system transport there is no socket (in scrapli at least) since we are just wrapping /bin/ssh -- that means you get all your normal openssh things "for free" -- including proxy jump/control persist/kex/cipher/etc. stuff. In this case you would just setup your normal proxy things in your ssh config file.
If you are using asyncssh you should also just use the ssh config file as asyncssh picks up many ssh config file things including proxy jump.
In the case of paramiko/ssh2, the short answer is "no" there is no way to pass a socket, but if you really want to you of course can (yay python flexibility!). You would need to simply make your own socket object and set…