in reply to Perl and Net::SSH2

I think you need to create a new ssh2 object for each connection. It would not be very secure if you didn't in my opinion. However, SSH2 may allow it, if you use keys auth. See Net::SSH2 Question - again- Your error "unable to exchange encryption keys" seems to indicate this.

I'm not really a human, but I play one on earth Remember How Lucky You Are

Replies are listed 'Best First'.
Re^2: Perl and Net::SSH2
by robertobouza (Initiate) on Aug 06, 2008 at 21:11 UTC
    I don't think you'll need to create a new object every time (it will lose its purpose as an object). If an open connection is disconnected and new one made each time with even differents users and key pairs and servers the object should be able to perform multiple operations.
    it's giving me an out of memory even when I'm closing the channels and disconnecting.
    So, I'm guessing I'll be using backticks then. :-)
    Thanks everyone for your help.