|Just another Perl shrine|
Re: Capturing SSH output in an array.by perl514 (Pilgrim)
|on Nov 20, 2012 at 16:06 UTC||Need Help??|
The script works fine if I include the username and password, but fails when I use the key_path => "/home/$user/.ssh/id_dsa"); option.
Here's the script:
And here is the error message
This is slightly modified version of your script and I am running this on my office laptop that has Windows 7 installed with DWIM Perl. The script is pointing to CentOS 6.2 running as Guest OS inside of VMWare Player. I am able to ping to it as well as putty into it, so no issues there.I thought that there could be issues with the way $username is being interpolated, but that's not the issue. The /home/$user/.ssh/id_dsa refers to id_dsa inside the CentOS 6.2. I am able to login to the Guest OS using the same username and password mentioned in the script, so any issues due wrong username and password are ruled out as well.
So I tried similar stuff using the Net::SSH2 module, because from what I understand, Net::SSH::Any module would use either Net::OpenSSH or Net::SSH2 in the backend. tried with Net::SSH2 and same error was observed. Not sure where I am going wrong. Please help me.
Perlpetually Indebted To PerlMonks