in reply to Re^2: Net::OpenSSH Multiple Commands - Session Destroyed
in thread Net::OpenSSH Multiple Commands - Session Destroyed

It seems that the SSH server on your particular device is not able to handle several requests over the same connection.

I can think of two workarounds for that:

  1. Open a new connection for every request
  2. Run a full interactive session on the server and use Expect to drive it (you can also try with Net::SSH::Expect or any of the other modules targeting specific Cisco devices).
  • Comment on Re^3: Net::OpenSSH Multiple Commands - Session Destroyed