Discussion:
Using paramiko with Cisco and other CLI network gear
Jacques van der Merwe
2010-06-07 13:18:10 UTC
Permalink
Greetings all,

I am interested to hear from any of you that are currently using
paramiko successfully with network gear CLI's. I've been struggling
with paramiko and Foundry load balancers and I was hoping to get some
advice from the list.

I have no problems using paramiko with a unix target, but as soon as I
start dealing with network gear my transport dies as soon as I provide
an exec_command(). For example:

DEB [20100607-14:41:58.630] thr=1 paramiko.transport: starting
thread (client mode): 0x504d83d0L
INF [20100607-14:41:58.831] thr=1 paramiko.transport: Connected
(version 2.0, client RomSShell_4.31)
DEB [20100607-14:41:58.931] thr=1 paramiko.transport: kex
algos:['diffie-hellman-group1-sha1'] server key:['ssh-dss'] client
encrypt:['3des-cbc'] server encrypt:['3des-cbc'] client
mac:['hmac-sha1'] server mac:['hmac-sha1'] client compress:['none']
server compress:['none'] client lang:[''] server lang:[''] kex
follows?False
DEB [20100607-14:41:58.931] thr=1 paramiko.transport: Ciphers
agreed: local=3des-cbc, remote=3des-cbc
DEB [20100607-14:41:58.932] thr=1 paramiko.transport: using kex
diffie-hellman-group1-sha1; server key type ssh-dss; cipher: local
3des-cbc, remote 3des-cbc; mac: local hmac-sha1, remote hmac-sha1;
compression: local none, remote none
DEB [20100607-14:41:59.309] thr=1 paramiko.transport: Switch to new keys ...
DEB [20100607-14:41:59.331] thr=2 paramiko.transport: Adding ssh-dss
host key for lb10.ats-fo.lks2: ff8fd7ddf360a6a1ced73833b5e279a2
DEB [20100607-14:41:59.334] thr=2 paramiko.transport: Trying SSH
agent key c0f9a8dcxxxxxxxxxxxxxcd14c3e13c6c84
DEB [20100607-14:41:59.435] thr=1 paramiko.transport: userauth is OK
INF [20100607-14:41:59.449] thr=1 paramiko.transport: Auth banner:
INF [20100607-14:41:59.551] thr=1 paramiko.transport: Authentication
(publickey) failed.
DEB [20100607-14:41:59.668] thr=1 paramiko.transport: userauth is OK
INF [20100607-14:41:59.669] thr=1 paramiko.transport: Auth banner:
INF [20100607-14:41:59.805] thr=1 paramiko.transport: Authentication
(password) successful!
DEB [20100607-14:42:25.299] thr=2 paramiko.transport: [chan 1] Max
packet in: 34816 bytes
DEB [20100607-14:42:25.401] thr=1 paramiko.transport: [chan 1] Max
packet out: 1338 bytes
INF [20100607-14:42:25.401] thr=1 paramiko.transport: Secsh channel 1 opened.
DEB [20100607-14:42:25.503] thr=1 paramiko.transport: [chan 1] Sesch
channel 1 request ok
DEB [20100607-14:42:25.504] thr=1 paramiko.transport: [chan 1] EOF
received (1)
DEB [20100607-14:42:25.504] thr=1 paramiko.transport: [chan 1] EOF sent (1)
DEB [20100607-14:42:25.505] thr=1 paramiko.transport: EOF in transport thread

I've attempted to enable a keepalive, but yet again as soon as I
attempt a exec_command(), the transport thread EOF's:

DEB [20100607-14:48:07.639] thr=4 paramiko.transport: starting
thread (client mode): 0x504dc110L
INF [20100607-14:48:07.839] thr=4 paramiko.transport: Connected
(version 2.0, client RomSShell_4.31)
DEB [20100607-14:48:07.939] thr=4 paramiko.transport: kex
algos:['diffie-hellman-group1-sha1'] server key:['ssh-dss'] client
encrypt:['3des-cbc'] server encrypt:['3des-cbc'] client
mac:['hmac-sha1'] server mac:['hmac-sha1'] client compress:['none']
server compress:['none'] client lang:[''] server lang:[''] kex
follows?False
DEB [20100607-14:48:07.939] thr=4 paramiko.transport: Ciphers
agreed: local=3des-cbc, remote=3des-cbc
DEB [20100607-14:48:07.939] thr=4 paramiko.transport: using kex
diffie-hellman-group1-sha1; server key type ssh-dss; cipher: local
3des-cbc, remote 3des-cbc; mac: local hmac-sha1, remote hmac-sha1;
compression: local none, remote none
DEB [20100607-14:48:08.317] thr=4 paramiko.transport: Switch to new keys ...
DEB [20100607-14:48:08.344] thr=2 paramiko.transport: Trying SSH
agent key c0f9a8dcxxxxxxxxxxxxxxx14c3e13c6c84
DEB [20100607-14:48:08.445] thr=4 paramiko.transport: userauth is OK
INF [20100607-14:48:08.459] thr=4 paramiko.transport: Auth banner:
INF [20100607-14:48:08.560] thr=4 paramiko.transport: Authentication
(publickey) failed.
DEB [20100607-14:48:08.679] thr=4 paramiko.transport: userauth is OK
INF [20100607-14:48:08.679] thr=4 paramiko.transport: Auth banner:
INF [20100607-14:48:08.814] thr=4 paramiko.transport: Authentication
(password) successful!
DEB [20100607-14:48:16.125] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:17.128] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:18.130] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:19.133] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:20.135] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:21.137] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:22.140] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:23.142] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:24.144] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:25.146] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:26.149] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:27.151] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:28.153] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:29.156] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:30.158] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:31.160] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:32.163] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:33.165] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:34.168] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:35.170] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:36.172] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:37.175] thr=4 paramiko.transport: Sending global
request "***@lag.net"
DEB [20100607-14:48:37.694] thr=4 paramiko.transport: EOF in transport thread

Any advice out there?

Cheers!
-Jacques

Loading...