[prev in list] [next in list] [prev in thread] [next in thread]
List: perl-win32-users
Subject: RE: :SSH::W32Perl -- connection problem to remote server
From: "Chad I. Uretsky" <chad.uretsky () netiq ! com>
Date: 2005-02-23 14:47:07
Message-ID: 218635ABE7700B4884A32D9D411A28B509FACCA9 () houexch04 ! us ! netiq ! corp
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Try changing $params{protocol}. Looks like your server is/may be running
version 1 of SSH, while you're trying to connect with version 2.
> Remote protocol version 1.99, remote software version OpenSSH_3.4p1
> Net::SSH::Perl Version 1.24, protocol version 2.0.
> No compat match: OpenSSH_3.4p1.
$params{protocol} = 1;
Chad Uretsky
Lead Network and Security Engineer
NetIQ Corporation
<mailto:chad.uretsky@netiq.com> chad.uretsky@netiq.com
Direct: 713-418-5200
<http://www.netiq.com/> www.netiq.com
-----Original Message-----
From: perl-win32-users-bounces@listserv.ActiveState.com
[mailto:perl-win32-users-bounces@listserv.ActiveState.com] On Behalf Of Eran
Kaufman
Sent: Wednesday, February 23, 2005 8:08 AM
To: perl-win32-users@listserv.ActiveState.com
Subject: Net::SSH::W32Perl -- connection problem to remote server
hi,
i'm currently trying to run the following code in order to connect to remote
Win2K server.
the remote Win2K server is running Cygwin which operates as the server.
here's the code:
my %params;
$params{debug} = 1;
$params{protocol} = 2;
$params{port} = 22;
$ssh = new Net::SSH::W32Perl($host, %params);
$ssh -> login($user, $pass);
($out, $err, $exit) = $ssh -> cmd('ls' ,"\n");
the code get stuck at the login line... here's the debug output:
Reading configuration data /.ssh/config
Reading configuration data /etc/ssh_config
Connecting to xx.xxx.xxx.xxx, port 22.
Socket created, turning on blocking...
Remote protocol version 1.99, remote software version OpenSSH_3.4p1
Net::SSH::Perl Version 1.24, protocol version 2.0.
No compat match: OpenSSH_3.4p1.
Connection established.
Sent key-exchange init (KEXINIT), wait response.
Algorithms, c->s: 3des-cbc hmac-sha1 none
Algorithms, s->c: 3des-cbc hmac-sha1 none
Entering Diffie-Hellman Group 1 key exchange.
Sent DH public key, waiting for reply.
Received host key, type 'ssh-dss'.
Host 'xx.xxx.xxx.xxx' is known and matches the host key.
Computing shared secret key.
Verifying server signature.
Waiting for NEWKEYS message.
Enabling incoming encryption/MAC/compression.
Send NEWKEYS, enable outgoing encryption/MAC/compression.
Sending request for user-authentication service.
Service accepted: ssh-userauth.
Trying empty user-authentication request.
Authentication methods that can continue:
publickey,password,keyboard-interactive.
Next method to try is publickey.
Next method to try is password.
Trying password authentication.
Login completed, opening dummy shell channel.
channel 0: new [client-session]
Requesting channel_open for channel 0.
channel 0: open confirm rwindow 0 rmax 32768
Got channel open confirmation, requesting shell.
Requesting service shell on channel 0.
channel 1: new [client-session]
Requesting channel_open for channel 1.
Entering interactive session.
Sending command: ls
Requesting service exec on channel 1.
channel 1: send eof
channel 1: open confirm rwindow 131071 rmax 32768
input_channel_request: rtype exit-status reply 0
help will be highly appreciated!
thanks,
eran
[Attachment #5 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o = "urn:schemas-microsoft-com:office:office" xmlns:st1 =
"urn:schemas-microsoft-com:office:smarttags"><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2900.2523" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=036134514-23022005><FONT color=#0000ff size=2>Try changing
$params{protocol}. Looks like your server is/may be running version 1
of SSH, while you're trying to connect with version 2.</FONT></SPAN></DIV>
<DIV><SPAN class=036134514-23022005><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=036134514-23022005><FONT color=#0000ff size=2><FONT
color=#000000><FONT face=Tahoma><SPAN style="mso-spacerun: yes">></SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Remote protocol version 1.99, remote
software version OpenSSH_3.4p1<BR><SPAN
style="mso-spacerun: yes">></SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Net::SSH::Perl Version 1.24, protocol
version 2.0.<BR><SPAN style="mso-spacerun: yes">></SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>No compat match:
OpenSSH_3.4p1.</FONT></FONT><BR></FONT></SPAN></DIV>
<DIV><SPAN class=036134514-23022005><FONT color=#0000ff size=2>$params{protocol}
= 1;</FONT></SPAN></DIV>
<DIV> </DIV><!-- Converted from text/rtf format -->
<P><SPAN lang=en-us><FONT size=2>Chad Uretsky</FONT></SPAN> <BR><SPAN
lang=en-us><FONT size=2>Lead Network</FONT> <FONT size=2>and Security</FONT>
<FONT size=2>Engineer</FONT></SPAN> <BR><SPAN lang=en-us><FONT size=2>NetIQ
Corporation</FONT></SPAN> <BR><SPAN lang=en-us></SPAN><A
href="mailto:chad.uretsky@netiq.com"><SPAN lang=en-us><U></U><U><FONT
color=#0000ff size=2>chad.uretsky@netiq.com</FONT></U></SPAN></A><SPAN
lang=en-us></SPAN> <BR><SPAN lang=en-us><FONT size=2>Direct:
713-418-5200</FONT></SPAN> <BR><SPAN lang=en-us></SPAN><A
href="http://www.netiq.com/"><SPAN lang=en-us><U></U><U><FONT color=#0000ff
size=2>www.netiq.com</FONT></U></SPAN></A><SPAN lang=en-us></SPAN> <BR><SPAN
lang=en-us> </SPAN> <BR><SPAN lang=en-us> </SPAN> <BR><SPAN
lang=en-us> </SPAN> </P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
perl-win32-users-bounces@listserv.ActiveState.com
[mailto:perl-win32-users-bounces@listserv.ActiveState.com] <B>On Behalf Of
</B>Eran Kaufman<BR><B>Sent:</B> Wednesday, February 23, 2005 8:08
AM<BR><B>To:</B> perl-win32-users@listserv.ActiveState.com<BR><B>Subject:</B>
Net::SSH::W32Perl -- connection problem to remote server<BR><BR></FONT></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt">hi,</SPAN><SPAN style="FONT-SIZE: 12pt; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt"><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt">i'm currently trying to run the following code in order to connect to remote \
Win2K server.</SPAN><SPAN
style="FONT-SIZE: 12pt; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt"><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt">the remote Win2K server is running Cygwin which operates as the
server.</SPAN><SPAN
style="FONT-SIZE: 12pt; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt"><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt">here's the code:</SPAN><SPAN
style="FONT-SIZE: 12pt; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt"><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 12pt; LETTER-SPACING: 0pt; mso-font-kerning: 0pt"><FONT
face="Times New Roman"> <o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; LETTER-SPACING: 0pt; \
mso-font-kerning: 0pt">my %params; <BR>$params{debug} = \
1; <BR>$params{protocol} = 2;<BR>$params{port} = 22;</SPAN><SPAN
style="FONT-SIZE: 12pt; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt"><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 12pt; LETTER-SPACING: 0pt; mso-font-kerning: 0pt"><FONT
face="Times New Roman"> <o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; LETTER-SPACING: 0pt; \
mso-font-kerning: 0pt">$ssh = new Net::SSH::W32Perl($host, %params);<BR>$ssh -> \
login($user, $pass);<BR>($out, $err, $exit) = $ssh -> cmd('ls' ,"\n"); \
</SPAN><SPAN style="FONT-SIZE: 12pt; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt"><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 12pt; LETTER-SPACING: 0pt; mso-font-kerning: 0pt"><FONT
face="Times New Roman"> <o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt">the code get stuck at the login line... here's the debug output:</SPAN><SPAN
style="FONT-SIZE: 12pt; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt"><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN><st1:City w:st="on">Reading</st1:City>
configuration data /.ssh/config<BR><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN><st1:place w:st="on"><st1:City
w:st="on">Reading</st1:City></st1:place> configuration data
/etc/ssh_config<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Connecting to xx.xxx.xxx.xxx, port
22.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Socket created, turning on
blocking...<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Remote protocol version 1.99, remote
software version OpenSSH_3.4p1<BR><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Net::SSH::Perl Version 1.24, protocol
version 2.0.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>No compat match:
OpenSSH_3.4p1.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Connection established.<BR><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Sent key-exchange init (KEXINIT), wait
response.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Algorithms, c->s: 3des-cbc hmac-sha1
none<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Algorithms, s->c: 3des-cbc hmac-sha1
none<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Entering Diffie-Hellman Group 1 key
exchange.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Sent DH public key, waiting for
reply.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Received host key, type
'ssh-dss'.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Host 'xx.xxx.xxx.xxx' is known and
matches the host key.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Computing shared secret key.<BR><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Verifying server signature.<BR><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Waiting for NEWKEYS message.<BR><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Enabling incoming
encryption/MAC/compression.<BR><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Send NEWKEYS, enable outgoing
encryption/MAC/compression.<BR><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Sending request for user-authentication
service.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Service accepted:
ssh-userauth.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Trying empty user-authentication
request.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Authentication methods that can
continue: publickey,password,keyboard-interactive.<BR><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Next method to try is
publickey.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Next method to try is
password.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Trying password
authentication.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Login completed, opening dummy shell
channel.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>channel 0: new
[client-session]<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Requesting channel_open for channel
0.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>channel 0: open confirm rwindow 0 rmax
32768<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Got channel open confirmation,
requesting shell.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Requesting service shell on channel
0.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>channel 1: new
[client-session]<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Requesting channel_open for channel
1.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Entering interactive session.<BR><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Sending command: ls<BR><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>Requesting service exec on channel
1.<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>channel 1: send eof<BR><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>channel 1: open confirm rwindow 131071
rmax 32768<BR><SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>input_channel_request: rtype
exit-status reply 0</SPAN><SPAN
style="FONT-SIZE: 12pt; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt"><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt"></SPAN> </P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt"></SPAN> </P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt">help will be highly appreciated!</SPAN><SPAN
style="FONT-SIZE: 12pt; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt"><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; LETTER-SPACING: 0pt; mso-font-kerning: \
0pt">thanks,</SPAN><SPAN style="FONT-SIZE: 12pt; LETTER-SPACING: 0pt; \
mso-font-kerning: 0pt"><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm \
0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; LETTER-SPACING: 0pt; \
mso-font-kerning: 0pt">eran</SPAN><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: \
Tahoma; LETTER-SPACING: 0pt; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P> <P \
class=MsoNormal style="MARGIN: 6pt 0cm 0pt"><o:p><FONT face="Times New \
Roman"> </FONT></o:p></P></BLOCKQUOTE></BODY></HTML>
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic