Python SSHv2 to Cisco routers for multiple commands
Sam Crooks
sam.a.crooks at gmail.com
Tue Mar 10 16:24:42 UTC 2009
Does anyone have any suggestions for SSHv2 to multiple Cisco devices and
(this is the catch) running multiple commands?
I've tried with Paramiko using the SSHClient(), then connect()'ing and
issuing exec_command(), and it seems that the router closes the channel
after the .exec_command('command here'). Subsequent write()'s on the stdin
file object returned do not work, as shown on the examples I have seen:
http://jessenoller.com/2009/02/05/ssh-programming-with-paramiko-completely-different/#more-465
I've tried various examples with twisted.conch.ssh and it seems Twisted is a
bit more low-level than paramiko's SSHClient class.
I'm trying to be able to issue a string of commands to routers which
require a particular sequence;
configure terminal
hostname blahrouter1
ip domain-name x.i.z
ip tftp source-interface lo0
end
copy tftp:/x.y.z.w/my/path/file.txt flash:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/toolmakers/attachments/20090310/290dc579/attachment.html>
More information about the Toolmakers
mailing list