Hate windows all you want. What is the easiest way to setup SSH on
Windows? Well, there’s PuTTY. But what about through Python?
20160610/https://wiki.python.org/moin/SecureShell
20160610/http://stackoverflow.com/questions/17228943/python-interactive-ssh-client-using-paramiko
I guess, you know the way Windows is, that downloading files from web
pages isn’t all that hard. Of course, that is really the only builtin
behavior that is guaranteed on Windows systems. ftp? Sometimes that
is available, sometimes not. So, those are your options for getting
data onto a Windows computer to begin with.
Okay, finally! I found it! It’s in the Paramiko source code
repository. Demos. Of course. I just needed to look a little bit
harder. Wow, sometimes it really surprises me that ta sub-par results
comes out on top in Google search results, but I should have known
better. You have been forewarned.
20160610/http://stackoverflow.com/questions/373639/running-interactive-commands-in-paramiko
20160610/https://github.com/paramiko/paramiko/tree/master/demos
20160610/https://github.com/paramiko/paramiko/blob/master/demos/interactive.py
Okay, so it works. Just run demo_simple.py', but don't forget to do
data.decode('utf-8') before writes in
interactive.py’! Yes, yes, the
demo code wasn’t quite ported to Python 3.
Oh yeah, there’s another caveat. ANSI escape sequences don’t get
translated inside of your NT command shell.
Read on →