<div>Does anyone have any suggestions for SSHv2 to multiple Cisco devices and (this is the catch) running multiple commands?</div>
<div> </div>
<div>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: <a href="http://jessenoller.com/2009/02/05/ssh-programming-with-paramiko-completely-different/#more-465">http://jessenoller.com/2009/02/05/ssh-programming-with-paramiko-completely-different/#more-465</a></div>
<div> </div>
<div> </div>
<div>I've tried various examples with twisted.conch.ssh and it seems Twisted is a bit more low-level than paramiko's SSHClient class.</div>
<div> </div>
<div> </div>
<div> </div>
<div>I'm trying to be able to issue a string of commands to routers which require a particular sequence;</div>
<div> </div>
<div>configure terminal</div>
<div>hostname blahrouter1</div>
<div>ip domain-name x.i.z</div>
<div> </div>
<div>ip tftp source-interface lo0</div>
<div>end</div>
<div> </div>
<div> </div>
<div>copy tftp:/x.y.z.w/my/path/file.txt flash:</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>