0

I need a helper library that actually makes an ssh connection. Not one that spawns another app to do so. (eg: pexpect). It also needs support automating the CLI interface. However it needs to be similar to pexpect in that it needs to wait for input (ie: a prompt with certain text in it). Ultimately it needs to be cross platform too (this why pexpect is a poor choice). Also very important to note: I am not logging into a linux shell. This is a custom CLI app. It must also support SSH, not SSH2.

Charles
  • 50,943
  • 13
  • 104
  • 142
Zombies
  • 25,039
  • 43
  • 140
  • 225
  • possible duplicate of [What is the simplest way to SSH using Python?](http://stackoverflow.com/questions/1233655/what-is-the-simplest-way-to-ssh-using-python) – Martijn Pieters Sep 10 '12 at 15:10
  • @Martijin Pieters: No. That question is closed already and IS the duplicate. – Zombies Sep 10 '12 at 15:13
  • 3
    I don't think we are talking about the same question.. – Martijn Pieters Sep 10 '12 at 15:15
  • 1
    Related: [Why no pure Python SSH1 (version 1) client implementations?](http://stackoverflow.com/questions/936783/why-no-pure-python-ssh1-version-1-client-implementations) – phihag Sep 10 '12 at 15:25

1 Answers1

6

paramiko or its fork ssh are ssh client implementations in native Python.

However, both only support the newer ssh v2 protocol. ssh v1 was fundamentally flawed. It is basically an obfuscated telnet and has been deprecated for a decade. Therefore, it is no longer in wide use.

If the remote supports it, use telnetlib to establish a telnet connection.

Community
  • 1
  • 1
phihag
  • 278,196
  • 72
  • 453
  • 469
  • I don't think I can use these... SSH2 isn't cross compatible with SSH: http://en.wikipedia.org/wiki/Secure_Shell#Version_2.x – Zombies Sep 10 '12 at 14:46
  • @Zombies: You never specified you needed SSH1 compatibility. – Martijn Pieters Sep 10 '12 at 15:11
  • 5
    @Zombies: With the advent of SSH2, the old protocol is now referred to as SSH1 (or 'SSH protocol version 1)', as the term `SSH` is ambiguous, as you've now surely discovered. – Martijn Pieters Sep 10 '12 at 15:16
  • @Zombies: From [Wikipedia](https://en.wikipedia.org/wiki/Secure_Shell): *"The protocol specification distinguishes two major versions that are referred to as SSH-1 and SSH-2."* As SSH2 has been around for 6 years now, *and* is the more secure variant, hardly anyone uses SSH1 anymore. If you need SSH1 compat, you need to specify that explicitly. – Martijn Pieters Sep 10 '12 at 15:22
  • 3
    @Zombies ssh1 is insecure (it doesn't even have a MAC) and therefore no longer used anymore. As to the allegation that I'm "blasting out as many answers as I can": I don't see what should be wrong with quickly answering a question, and looking at my [activity tab](http://stackoverflow.com/users/35070/phihag?tab=activity), you can see I blasted out ... *one* answer today. – phihag Sep 10 '12 at 15:23
  • 2
    @Zombies, insulting someone who's trying to help isn't likely to give you the answer you seek. – Mark Ransom Sep 10 '12 at 15:25