Hello
I´m having many problems to make a SSH connection works here. I'm using Windows.
I tried to use Net::SSH::Perl but it generated the following error:
Can't set socket non-blocking: Bad file descriptor at C:/Perl/site/lib
+/Net/SSH/Perl.pm line 216.
I tried to use Net::SSH::W32Perl but it generated the following error (Math::BigInt and Math::BigInt::FastCalc are installed):
Math::BigInt: couldn't load specified math lib(s), fallback to Math::B
+igInt::FastCalc at C:/Perl/site/lib/Crypt/DSA/KeyChain.pm line 6
Math::BigInt: couldn't load specified math lib(s), fallback to Math::B
+igInt::FastCalc at C:/Perl/site/lib/Crypt/DSA/Key.pm line 6
Math::BigInt: couldn't load specified math lib(s), fallback to Math::B
+igInt::FastCalc at C:/Perl/site/lib/Crypt/DSA/Util.pm line 6
Not an ARRAY reference at C:/Perl/site/lib/Math/BigInt/Calc.pm line 25
+1.
Here is the code
#!/usr/bin/perl -w
use Net::SSH::W32Perl;
use Win32;
$ENV{USERNAME} = Win32::LoginName();
$ENV{HOME} = Win32::GetFolderPath( Win32::CSIDL_PERSONAL );
$ip = 'x.x.x.x';
$ssh = Net::SSH::W32Perl->new($ip);
$ssh->login("username","password");
($out,$err,$ext) = $ssh->cmd("ls");
$ssh->close();
What am I doing wrong?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.