phpseclib登录失败,主机名错误还是什么?

时间:2013-09-28 12:44:40

标签: php upload sftp phpseclib

我在尝试连接到我的sftp时遇到了phpseclib的严重问题。问题是我总是收到登录失败,我不知道如何调试代码。

include('Net/SFTP.php');
include('Crypt/RSA.php');
$sftp=new Net_SFTP('192.1xx.x.xxx');
if (!$sftp->login('webmaster','981xxxxxxxxxxxxx£1')){
    exit ('Login Failed'); //code always produces this
}
...

现在,我必须在filezilla上输入的凭据是代码中列出的凭据,但我的猜测是问题可能是主机名。是不是如果在filezilla上我只需输入上面的IP,那么我在这里也必须输入IP?

我的sftp作为前端网站,只能通过VPN访问(显然我已连接到)。

请帮助我解决这个问题,我已经尝试了很多主机名格式,它总是会产生错误,我真的不知道如何解决这个问题,另外霜冻phpseclib专用论坛似乎是离线... < / p>


这是我得到的日志

<pre>&lt;-
00000000  53:48:2d:32:2e:30:2d:4f:70:65:6e:53:53:48:5f:35  SH-2.0-OpenSSH_5
00000010  2e:32:0d:0a                                      .2..

-&gt;
00000000  53:48:2d:32:2e:30:2d:70:68:70:73:65:63:6c:69:62  SH-2.0-phpseclib
00000010  5f:30:2e:33:20:28:62:63:6d:61:74:68:29:0d:0a     _0.3 (bcmath)..

&lt;- NET_SSH2_MSG_KEXINIT (since last: 0.0131, network: 0.0019s)
00000000  49:b5:84:f2:10:8c:d0:4a:f3:ed:79:1a:4b:d4:c9:fa  I......J..y.K...
00000010  00:00:00:7e:64:69:66:66:69:65:2d:68:65:6c:6c:6d  ...~diffie-hellm
00000020  61:6e:2d:67:72:6f:75:70:2d:65:78:63:68:61:6e:67  an-group-exchang
00000030  65:2d:73:68:61:32:35:36:2c:64:69:66:66:69:65:2d  e-sha256,diffie-
00000040  68:65:6c:6c:6d:61:6e:2d:67:72:6f:75:70:2d:65:78  hellman-group-ex
00000050  63:68:61:6e:67:65:2d:73:68:61:31:2c:64:69:66:66  change-sha1,diff
00000060  69:65:2d:68:65:6c:6c:6d:61:6e:2d:67:72:6f:75:70  ie-hellman-group
00000070  31:34:2d:73:68:61:31:2c:64:69:66:66:69:65:2d:68  14-sha1,diffie-h
00000080  65:6c:6c:6d:61:6e:2d:67:72:6f:75:70:31:2d:73:68  ellman-group1-sh
00000090  61:31:00:00:00:0f:73:73:68:2d:72:73:61:2c:73:73  a1....ssh-rsa,ss
000000a0  68:2d:64:73:73:00:00:00:9d:61:65:73:31:32:38:2d  h-dss....aes128-
000000b0  63:74:72:2c:61:65:73:31:39:32:2d:63:74:72:2c:61  ctr,aes192-ctr,a
000000c0  65:73:32:35:36:2d:63:74:72:2c:61:72:63:66:6f:75  es256-ctr,arcfou
000000d0  72:32:35:36:2c:61:72:63:66:6f:75:72:31:32:38:2c  r256,arcfour128,
000000e0  61:65:73:31:32:38:2d:63:62:63:2c:33:64:65:73:2d  aes128-cbc,3des-
000000f0  63:62:63:2c:62:6c:6f:77:66:69:73:68:2d:63:62:63  cbc,blowfish-cbc
00000100  2c:63:61:73:74:31:32:38:2d:63:62:63:2c:61:65:73  ,cast128-cbc,aes
00000110  31:39:32:2d:63:62:63:2c:61:65:73:32:35:36:2d:63  192-cbc,aes256-c
00000120  62:63:2c:61:72:63:66:6f:75:72:2c:72:69:6a:6e:64  bc,arcfour,rijnd
00000130  61:65:6c:2d:63:62:63:40:6c:79:73:61:74:6f:72:2e  ael-cbc@lysator.
00000140  6c:69:75:2e:73:65:00:00:00:9d:61:65:73:31:32:38  liu.se....aes128
00000150  2d:63:74:72:2c:61:65:73:31:39:32:2d:63:74:72:2c  -ctr,aes192-ctr,
00000160  61:65:73:32:35:36:2d:63:74:72:2c:61:72:63:66:6f  aes256-ctr,arcfo
00000170  75:72:32:35:36:2c:61:72:63:66:6f:75:72:31:32:38  ur256,arcfour128
00000180  2c:61:65:73:31:32:38:2d:63:62:63:2c:33:64:65:73  ,aes128-cbc,3des
00000190  2d:63:62:63:2c:62:6c:6f:77:66:69:73:68:2d:63:62  -cbc,blowfish-cb
000001a0  63:2c:63:61:73:74:31:32:38:2d:63:62:63:2c:61:65  c,cast128-cbc,ae
000001b0  73:31:39:32:2d:63:62:63:2c:61:65:73:32:35:36:2d  s192-cbc,aes256-
000001c0  63:62:63:2c:61:72:63:66:6f:75:72:2c:72:69:6a:6e  cbc,arcfour,rijn
000001d0  64:61:65:6c:2d:63:62:63:40:6c:79:73:61:74:6f:72  dael-cbc@lysator
000001e0  2e:6c:69:75:2e:73:65:00:00:00:69:68:6d:61:63:2d  .liu.se...ihmac-
000001f0  6d:64:35:2c:68:6d:61:63:2d:73:68:61:31:2c:75:6d  md5,hmac-sha1,um
00000200  61:63:2d:36:34:40:6f:70:65:6e:73:73:68:2e:63:6f  ac-64@openssh.co
00000210  6d:2c:68:6d:61:63:2d:72:69:70:65:6d:64:31:36:30  m,hmac-ripemd160
00000220  2c:68:6d:61:63:2d:72:69:70:65:6d:64:31:36:30:40  ,hmac-ripemd160@
00000230  6f:70:65:6e:73:73:68:2e:63:6f:6d:2c:68:6d:61:63  openssh.com,hmac
00000240  2d:73:68:61:31:2d:39:36:2c:68:6d:61:63:2d:6d:64  -sha1-96,hmac-md
00000250  35:2d:39:36:00:00:00:69:68:6d:61:63:2d:6d:64:35  5-96...ihmac-md5
00000260  2c:68:6d:61:63:2d:73:68:61:31:2c:75:6d:61:63:2d  ,hmac-sha1,umac-
00000270  36:34:40:6f:70:65:6e:73:73:68:2e:63:6f:6d:2c:68  64@openssh.com,h
00000280  6d:61:63:2d:72:69:70:65:6d:64:31:36:30:2c:68:6d  mac-ripemd160,hm
00000290  61:63:2d:72:69:70:65:6d:64:31:36:30:40:6f:70:65  ac-ripemd160@ope
000002a0  6e:73:73:68:2e:63:6f:6d:2c:68:6d:61:63:2d:73:68  nssh.com,hmac-sh
000002b0  61:31:2d:39:36:2c:68:6d:61:63:2d:6d:64:35:2d:39  a1-96,hmac-md5-9
000002c0  36:00:00:00:15:6e:6f:6e:65:2c:7a:6c:69:62:40:6f  6....none,zlib@o
000002d0  70:65:6e:73:73:68:2e:63:6f:6d:00:00:00:15:6e:6f  penssh.com....no
000002e0  6e:65:2c:7a:6c:69:62:40:6f:70:65:6e:73:73:68:2e  ne,zlib@openssh.
000002f0  63:6f:6d:00:00:00:00:00:00:00:00:00:00:00:00:00  com.............

-&gt; NET_SSH2_MSG_KEXINIT (since last: 0.0002, network: 0s)
00000000  96:5b:d4:42:af:e9:dc:8a:77:7e:eb:db:f5:16:c1:0a  .[.B....w~......
00000010  00:00:00:36:64:69:66:66:69:65:2d:68:65:6c:6c:6d  ...6diffie-hellm
00000020  61:6e:2d:67:72:6f:75:70:31:2d:73:68:61:31:2c:64  an-group1-sha1,d
00000030  69:66:66:69:65:2d:68:65:6c:6c:6d:61:6e:2d:67:72  iffie-hellman-gr
00000040  6f:75:70:31:34:2d:73:68:61:31:00:00:00:0f:73:73  oup14-sha1....ss
00000050  68:2d:72:73:61:2c:73:73:68:2d:64:73:73:00:00:00  h-rsa,ssh-dss...
00000060  f6:61:72:63:66:6f:75:72:32:35:36:2c:61:72:63:66  .arcfour256,arcf
00000070  6f:75:72:31:32:38:2c:61:72:63:66:6f:75:72:2c:61  our128,arcfour,a
00000080  65:73:31:32:38:2d:63:74:72:2c:61:65:73:31:39:32  es128-ctr,aes192
00000090  2d:63:74:72:2c:61:65:73:32:35:36:2d:63:74:72:2c  -ctr,aes256-ctr,
000000a0  62:6c:6f:77:66:69:73:68:2d:63:74:72:2c:74:77:6f  blowfish-ctr,two
000000b0  66:69:73:68:31:32:38:2d:63:74:72:2c:74:77:6f:66  fish128-ctr,twof
000000c0  69:73:68:31:39:32:2d:63:74:72:2c:74:77:6f:66:69  ish192-ctr,twofi
000000d0  73:68:32:35:36:2d:63:74:72:2c:61:65:73:31:32:38  sh256-ctr,aes128
000000e0  2d:63:62:63:2c:61:65:73:31:39:32:2d:63:62:63:2c  -cbc,aes192-cbc,
000000f0  61:65:73:32:35:36:2d:63:62:63:2c:62:6c:6f:77:66  aes256-cbc,blowf
00000100  69:73:68:2d:63:62:63:2c:74:77:6f:66:69:73:68:31  ish-cbc,twofish1
00000110  32:38:2d:63:62:63:2c:74:77:6f:66:69:73:68:31:39  28-cbc,twofish19
00000120  32:2d:63:62:63:2c:74:77:6f:66:69:73:68:32:35:36  2-cbc,twofish256
00000130  2d:63:62:63:2c:74:77:6f:66:69:73:68:2d:63:62:63  -cbc,twofish-cbc
00000140  2c:33:64:65:73:2d:63:74:72:2c:33:64:65:73:2d:63  ,3des-ctr,3des-c
00000150  62:63:2c:6e:6f:6e:65:00:00:00:f6:61:72:63:66:6f  bc,none....arcfo
00000160  75:72:32:35:36:2c:61:72:63:66:6f:75:72:31:32:38  ur256,arcfour128
00000170  2c:61:72:63:66:6f:75:72:2c:61:65:73:31:32:38:2d  ,arcfour,aes128-
00000180  63:74:72:2c:61:65:73:31:39:32:2d:63:74:72:2c:61  ctr,aes192-ctr,a
00000190  65:73:32:35:36:2d:63:74:72:2c:62:6c:6f:77:66:69  es256-ctr,blowfi
000001a0  73:68:2d:63:74:72:2c:74:77:6f:66:69:73:68:31:32  sh-ctr,twofish12
000001b0  38:2d:63:74:72:2c:74:77:6f:66:69:73:68:31:39:32  8-ctr,twofish192
000001c0  2d:63:74:72:2c:74:77:6f:66:69:73:68:32:35:36:2d  -ctr,twofish256-
000001d0  63:74:72:2c:61:65:73:31:32:38:2d:63:62:63:2c:61  ctr,aes128-cbc,a
000001e0  65:73:31:39:32:2d:63:62:63:2c:61:65:73:32:35:36  es192-cbc,aes256
000001f0  2d:63:62:63:2c:62:6c:6f:77:66:69:73:68:2d:63:62  -cbc,blowfish-cb
00000200  63:2c:74:77:6f:66:69:73:68:31:32:38:2d:63:62:63  c,twofish128-cbc
00000210  2c:74:77:6f:66:69:73:68:31:39:32:2d:63:62:63:2c  ,twofish192-cbc,
00000220  74:77:6f:66:69:73:68:32:35:36:2d:63:62:63:2c:74  twofish256-cbc,t
00000230  77:6f:66:69:73:68:2d:63:62:63:2c:33:64:65:73:2d  wofish-cbc,3des-
00000240  63:74:72:2c:33:64:65:73:2d:63:62:63:2c:6e:6f:6e  ctr,3des-cbc,non
00000250  65:00:00:00:30:68:6d:61:63:2d:73:68:61:31:2d:39  e...0hmac-sha1-9
00000260  36:2c:68:6d:61:63:2d:73:68:61:31:2c:68:6d:61:63  6,hmac-sha1,hmac
00000270  2d:6d:64:35:2d:39:36:2c:68:6d:61:63:2d:6d:64:35  -md5-96,hmac-md5
00000280  2c:6e:6f:6e:65:00:00:00:30:68:6d:61:63:2d:73:68  ,none...0hmac-sh
00000290  61:31:2d:39:36:2c:68:6d:61:63:2d:73:68:61:31:2c  a1-96,hmac-sha1,
000002a0  68:6d:61:63:2d:6d:64:35:2d:39:36:2c:68:6d:61:63  hmac-md5-96,hmac
000002b0  2d:6d:64:35:2c:6e:6f:6e:65:00:00:00:04:6e:6f:6e  -md5,none....non
000002c0  65:00:00:00:04:6e:6f:6e:65:00:00:00:00:00:00:00  e....none.......
000002d0  00:00:00:00:00:00                                ......

-&gt; NET_SSH2_MSG_KEXDH_INIT (since last: 0.0074, network: 0s)
00000000  00:00:00:80:28:3e:a7:65:4a:eb:c1:5a:70:48:c3:a6  ....(&gt;.eJ..ZpH..
00000010  b4:74:95:8d:db:53:eb:9b:4c:44:4c:ed:55:27:cd:d5  .t...S..LDL.U'..
00000020  52:80:21:f2:cb:1d:50:1a:32:22:a5:4a:71:93:c8:fb  R.!...P.2".Jq...
00000030  e3:14:3a:1c:50:00:13:ce:34:84:a5:b7:30:c5:f6:e5  ..:.P...4...0...
00000040  87:44:c8:58:1a:40:a7:b4:79:ab:54:4a:91:8e:30:8f  .D.X.@..y.TJ..0.
00000050  d7:9b:c8:29:09:55:d0:a3:55:8d:f4:2c:68:b5:a1:25  ...).U..U..,h..%
00000060  03:07:5c:2f:9b:1d:a9:be:16:a3:62:10:d7:db:9d:84  ..\/......b.....
00000070  73:c5:b0:a8:7d:43:30:57:8b:1b:5c:27:2f:45:cc:54  s...}C0W..\'/E.T
00000080  ac:04:7b:5d                                      ..{]

&lt;- NET_SSH2_MSG_KEXDH_REPLY (since last: 0.0101, network: 0.0101s)
00000000  00:00:01:15:00:00:00:07:73:73:68:2d:72:73:61:00  ........ssh-rsa.
00000010  00:00:01:23:00:00:01:01:00:d2:24:c2:ed:85:c7:dc  ...#......$.....
00000020  08:ea:a1:a3:39:26:16:f7:48:d2:d1:65:61:d5:fa:03  ....9&amp;..H..ea...
00000030  00:0e:e5:f6:c3:75:1b:40:01:c0:20:20:33:28:1a:bb  .....u.@..  3(..
00000040  f0:f4:2b:1e:19:32:c0:2a:8a:2d:56:3f:d1:39:53:c4  ..+..2.*.-V?.9S.
00000050  12:ac:3a:f3:99:bc:86:85:ec:cf:a0:f0:4b:e2:6c:b8  ..:.........K.l.
00000060  78:0a:97:d7:26:09:05:92:54:d7:63:36:01:1b:9e:39  x...&amp;...T.c6...9
00000070  a2:06:01:82:41:99:0e:78:cf:4b:6e:90:e0:73:5d:75  ....A..x.Kn..s]u
00000080  a5:39:f0:67:b4:9d:f8:1a:93:93:ce:b4:77:46:2a:b3  .9.g........wF*.
00000090  17:e7:27:44:4c:c7:a2:d3:ee:d9:1a:a3:a9:82:d0:7f  ..'DL...........
000000a0  8d:09:25:2d:e2:20:cf:cb:b6:d4:7d:c7:c8:fe:08:e3  ..%-. ....}.....
000000b0  94:c9:ea:22:7f:e3:9d:d9:c2:e8:22:8b:2b:08:ed:89  ..."......".+...
000000c0  ec:1e:50:04:c2:6d:43:83:c1:7a:03:b9:5d:0c:75:ab  ..P..mC..z..].u.
000000d0  ed:cd:27:7f:82:7c:37:c3:84:62:6d:98:98:0e:87:c2  ..'..|7..bm.....
000000e0  0a:8d:9a:53:95:0c:90:c2:7d:d4:ca:0f:a8:02:a2:fe  ...S....}.......
000000f0  f9:8e:0e:f6:f2:93:20:b0:62:2d:9d:15:a8:4d:b6:b6  ...... .b-...M..
00000100  94:80:dd:0b:5d:f6:40:2b:8d:19:f8:3b:d3:db:66:5e  ....].@+...;..f^
00000110  53:c5:8e:61:58:51:fe:61:91:00:00:00:81:00:98:7c  S..aXQ.a.......|
00000120  47:db:55:e0:da:84:2a:8e:82:07:cd:55:98:56:18:07  G.U...*....U.V..
00000130  95:b5:b2:bc:5f:e6:82:03:8e:19:b2:24:c4:23:fe:a6  ...._......$.#..
00000140  da:ef:34:21:b4:e3:c4:98:c8:13:b9:89:c2:7d:bb:9c  ..4!.........}..
00000150  03:87:1c:9f:b5:ca:5d:2c:dc:8e:08:4c:4f:1b:df:55  ......],...LO..U
00000160  ad:6a:8d:2a:37:1e:a8:43:8f:b8:5b:dc:9f:10:c0:d2  .j.*7..C..[.....
00000170  70:72:e1:4c:35:14:a9:58:44:26:cd:bb:05:53:2a:b4  pr.L5..XD&amp;...S*.
00000180  1d:8d:8f:ee:bd:71:e5:14:ea:a2:72:21:58:3b:7e:c4  .....q....r!X;~.
00000190  2d:92:56:d5:4a:ba:ed:0c:12:a9:84:a5:46:62:00:00  -.V.J.......Fb..
000001a0  01:0f:00:00:00:07:73:73:68:2d:72:73:61:00:00:01  ......ssh-rsa...
000001b0  00:95:6c:3a:5c:21:2a:50:93:51:68:3c:60:ed:d5:81  ..l:\!*P.Qh.`...
000001c0  4a:4b:eb:7c:53:a0:17:45:57:08:a6:b5:17:74:8d:99  JK.|S..EW....t..
000001d0  5b:bc:4a:af:11:1e:15:04:e1:03:63:ee:be:af:f5:e4  [.J.......c.....
000001e0  4d:66:62:08:27:04:96:c6:74:84:73:d2:99:16:c5:cf  Mfb.'...t.s.....
000001f0  ee:74:17:a2:fe:e9:52:c0:4f:ad:78:bd:6e:fc:8d:59  .t....R.O.x.n..Y
00000200  82:39:9e:98:bb:da:00:6c:73:35:1b:c6:56:b2:6e:8a  .9.....ls5..V.n.
00000210  5f:20:46:e2:d7:09:0b:48:c0:46:56:30:af:f2:53:23  _ F....H.FV0..S#
00000220  83:d0:d8:8f:9c:72:da:a8:6c:24:fa:4d:0b:f5:a3:58  .....r..l$.M...X
00000230  8c:5f:59:d0:95:80:b7:ec:e1:4f:93:65:c5:24:e3:cb  ._Y......O.e.$..
00000240  82:5c:d7:f8:21:f8:74:2a:39:11:7c:07:a7:f9:48:33  .\..!.t*9.|...H3
00000250  94:ee:79:1a:a4:a0:78:b2:e1:df:3e:97:2f:04:ff:88  ..y...x...&gt;./...
00000260  c0:49:5d:cd:ee:01:b5:bd:ee:37:2a:95:60:68:e0:b1  .I]......7*.`h..
00000270  92:98:62:6d:f6:bc:81:30:4d:d0:e9:1c:38:ae:bc:af  ..bm...0M...8...
00000280  29:2a:bb:65:26:55:73:bf:13:ef:a5:9a:ea:a5:02:75  )*.e&amp;Us........u
00000290  04:89:d8:b9:55:2c:81:e1:b2:b0:f8:fa:e8:f7:dc:f0  ....U,..........
000002a0  ad:f8:f0:c4:c2:78:4c:2a:f9:b6:2c:b2:3f:da:30:d2  .....xL*..,.?.0.
000002b0  28                                               (

-&gt; NET_SSH2_MSG_NEWKEYS (since last: 0.0084, network: 0s)


&lt;- NET_SSH2_MSG_NEWKEYS (since last: 0, network: 0s)


-&gt; NET_SSH2_MSG_SERVICE_REQUEST (since last: 0.0064, network: 0s)
00000000  00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74:68  ....ssh-userauth

&lt;- NET_SSH2_MSG_SERVICE_ACCEPT (since last: 0.0002, network: 0.0001s)
00000000  00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74:68  ....ssh-userauth

-&gt; NET_SSH2_MSG_USERAUTH_REQUEST (since last: 0.0002, network: 0s)
00000000  32:00:00:00:08:75:73:65:72:6e:61:6d:65:00:00:00  2....username...
00000010  0e:73:73:68:2d:63:6f:6e:6e:65:63:74:69:6f:6e:00  .ssh-connection.
00000020  00:00:08:70:61:73:73:77:6f:72:64:00:00:00:00:08  ...password.....
00000030  70:61:73:73:77:6f:72:64                          password

&lt;- NET_SSH2_MSG_USERAUTH_FAILURE (since last: 0.0012, network: 0.0011s)
00000000  00:00:00:3b:70:75:62:6c:69:63:6b:65:79:2c:67:73  ...;publickey,gs
00000010  73:61:70:69:2d:6b:65:79:65:78:2c:67:73:73:61:70  sapi-keyex,gssap
00000020  69:2d:77:69:74:68:2d:6d:69:63:2c:6b:65:79:62:6f  i-with-mic,keybo
00000030  61:72:64:2d:69:6e:74:65:72:61:63:74:69:76:65:00  ard-interactive.

-&gt; NET_SSH2_MSG_USERAUTH_REQUEST (since last: 0.0002, network: 0s)
00000000  00:00:00:09:77:65:62:6d:61:73:74:65:72:00:00:00  ....webmaster...
00000010  0e:73:73:68:2d:63:6f:6e:6e:65:63:74:69:6f:6e:00  .ssh-connection.
00000020  00:00:14:6b:65:79:62:6f:61:72:64:2d:69:6e:74:65  ...keyboard-inte
00000030  72:61:63:74:69:76:65:00:00:00:00:00:00:00:00     ractive........

&lt;- NET_SSH2_MSG_USERAUTH_INFO_REQUEST (60) (since last: 0.0089, network: 0.0088s)
00000000  00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01  ................
00000010  00:00:00:09:50:61:73:73:77:6f:72:64:3a:00        ....Password:.

-&gt; NET_SSH2_MSG_USERAUTH_INFO_RESPONSE (61) (since last: 0.0002, network: 0s)
00000000  3d:00:00:00:01:00:00:00:0c:64:75:6d:6d:79:2d:61  =........dummy-a
00000010  6e:73:77:65:72                                   nswer

&lt;- NET_SSH2_MSG_USERAUTH_FAILURE (since last: 0.0015, network: 0.0013s)
00000000  00:00:00:3b:70:75:62:6c:69:63:6b:65:79:2c:67:73  ...;publickey,gs
00000010  73:61:70:69:2d:6b:65:79:65:78:2c:67:73:73:61:70  sapi-keyex,gssap
00000020  69:2d:77:69:74:68:2d:6d:69:63:2c:6b:65:79:62:6f  i-with-mic,keybo
00000030  61:72:64:2d:69:6e:74:65:72:61:63:74:69:76:65:00  ard-interactive.

Login Failed

这是PuTTY日志,仅限于SSH“身份验证

Event Log: Host key fingerprint is:
Event Log: ssh-rsa 2048 02:08:11:03:8c:07:ca:41:2f:01:1c:32:2c:e0:d5:7a
Outgoing packet #0x3, type 21 / 0x15 (SSH2_MSG_NEWKEYS)
Event Log: Initialised AES-256 SDCTR client->server encryption
Event Log: Initialised HMAC-SHA1 client->server MAC algorithm
Incoming packet #0x3, type 21 / 0x15 (SSH2_MSG_NEWKEYS)
Event Log: Initialised AES-256 SDCTR server->client encryption
Event Log: Initialised HMAC-SHA1 server->client MAC algorithm
Outgoing packet #0x4, type 5 / 0x05 (SSH2_MSG_SERVICE_REQUEST)
  00000000  00 00 00 0c 73 73 68 2d 75 73 65 72 61 75 74 68  ....ssh-userauth
Incoming packet #0x4, type 6 / 0x06 (SSH2_MSG_SERVICE_ACCEPT)
  00000000  00 00 00 0c 73 73 68 2d 75 73 65 72 61 75 74 68  ....ssh-userauth
Outgoing packet #0x5, type 50 / 0x32 (SSH2_MSG_USERAUTH_REQUEST)
  00000000  00 00 00 09 77 65 62 6d 61 73 74 65 72 00 00 00  ....webmaster...
  00000010  0e 73 73 68 2d 63 6f 6e 6e 65 63 74 69 6f 6e 00  .ssh-connection.
  00000020  00 00 04 6e 6f 6e 65                             ...none
Incoming packet #0x5, type 51 / 0x33 (SSH2_MSG_USERAUTH_FAILURE)
  00000000  00 00 00 3b 70 75 62 6c 69 63 6b 65 79 2c 67 73  ...;publickey,gs
  00000010  73 61 70 69 2d 6b 65 79 65 78 2c 67 73 73 61 70  sapi-keyex,gssap
  00000020  69 2d 77 69 74 68 2d 6d 69 63 2c 6b 65 79 62 6f  i-with-mic,keybo
  00000030  61 72 64 2d 69 6e 74 65 72 61 63 74 69 76 65 00  ard-interactive.
Event Log: Using SSPI from SECUR32.DLL
Event Log: Attempting GSSAPI authentication
Outgoing packet #0x6, type 50 / 0x32 (SSH2_MSG_USERAUTH_REQUEST)
  00000000  00 00 00 09 77 65 62 6d 61 73 74 65 72 00 00 00  ....webmaster...
  00000010  0e 73 73 68 2d 63 6f 6e 6e 65 63 74 69 6f 6e 00  .ssh-connection.
  00000020  00 00 0f 67 73 73 61 70 69 2d 77 69 74 68 2d 6d  ...gssapi-with-m
  00000030  69 63 00 00 00 01 00 00 00 0b 06 09 2a 86 48 86  ic..........*.H.
  00000040  f7 12 01 02 02                                   .....
Incoming packet #0x6, type 60 / 0x3c (SSH2_MSG_USERAUTH_GSSAPI_RESPONSE)
  00000000  00 00 00 0b 06 09 2a 86 48 86 f7 12 01 02 02     ......*.H......
Event Log: GSSAPI authentication failed to get credentials
Outgoing packet #0x7, type 50 / 0x32 (SSH2_MSG_USERAUTH_REQUEST)
  00000000  00 00 00 09 77 65 62 6d 61 73 74 65 72 00 00 00  ....webmaster...
  00000010  0e 73 73 68 2d 63 6f 6e 6e 65 63 74 69 6f 6e 00  .ssh-connection.
  00000020  00 00 14 6b 65 79 62 6f 61 72 64 2d 69 6e 74 65  ...keyboard-inte
  00000030  72 61 63 74 69 76 65 00 00 00 00 00 00 00 00     ractive........
Event Log: Attempting keyboard-interactive authentication
Incoming packet #0x7, type 60 / 0x3c (SSH2_MSG_USERAUTH_INFO_REQUEST)
  00000000  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01  ................
  00000010  00 00 00 09 50 61 73 73 77 6f 72 64 3a 00        ....Password:.
Outgoing packet #0x8, type 61 / 0x3d (SSH2_MSG_USERAUTH_INFO_RESPONSE)
  00000000  00 00 00 01 XX XX XX XX XX XX XX XX XX XX XX XX  ....XXXXXXXXXXXX
  00000010  XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX     XXXXXXXXXXXXXXX
Outgoing packet #0x9, type 2 / 0x02 (SSH2_MSG_IGNORE)
  00000000  00 00 00 c0 ea 39 ff da 81 f2 ee 71 f7 f5 09 c0  .....9.....q....
  00000010  70 54 09 0e 13 5a 17 7d 38 98 3c af 87 e4 14 ec  pT...Z.}8.<.....
  00000020  3c cd ce 52 6e a8 44 5a b7 09 be 79 60 58 69 f9  <..Rn.DZ...y`Xi.
  00000030  7b 89 9f 54 ac c1 89 08 04 12 dd 4d 84 2b d4 06  {..T.......M.+..
  00000040  0d 9b 9b 74 3f 9f a5 19 71 11 62 fd de 9d cf 69  ...t?...q.b....i
  00000050  c1 f0 1c 6e 8c ae f8 3e 59 bc f9 05 b9 39 fd 7f  ...n...>Y....9..
  00000060  51 9b 59 ed 52 77 ef 46 b9 95 df d3 a5 3d 7f ef  Q.Y.Rw.F.....=..
  00000070  53 b6 ac 3e 23 31 cc 24 dc bd 08 60 03 80 68 62  S..>#1.$...`..hb
  00000080  68 02 60 8f 21 c5 2e 3d 38 b8 e9 fa 2b 9b 82 26  h.`.!..=8...+..&
  00000090  ef 6b 7f 39 94 81 14 02 3a 57 41 58 7b 48 76 ba  .k.9....:WAX{Hv.
  000000a0  38 c6 09 eb e0 0b 34 d3 bc 85 1c 54 ce de aa 5d  8.....4....T...]
  000000b0  16 44 40 a5 a4 ef 2f 3a e2 27 36 51 d3 dc ff fd  .D@.../:.'6Q....
  000000c0  3b 21 12 f5                                      ;!..
Incoming packet #0x8, type 60 / 0x3c (SSH2_MSG_USERAUTH_INFO_REQUEST)
  00000000  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
Outgoing packet #0xa, type 61 / 0x3d (SSH2_MSG_USERAUTH_INFO_RESPONSE)
  00000000  00 00 00 00                                      ....
Outgoing packet #0xb, type 2 / 0x02 (SSH2_MSG_IGNORE)
  00000000  00 00 00 e0 3f 48 3c ca 78 51 67 44 d2 a7 fb cb  ....?H<.xQgD....
  00000010  78 cc f2 36 15 ba 0f 7f 42 7b 21 1b 9e 25 2c 1b  x..6....B{!..%,.
  00000020  8d 27 7f 7e df b5 4e af d8 d5 a3 a8 fc dd d9 39  .'.~..N........9
  00000030  bc ab 30 9e 12 29 16 7e 98 9c f1 fe c3 8d e9 1c  ..0..).~........
  00000040  65 59 b0 22 d0 c1 cd 22 8e 11 44 2c 2e 99 26 81  eY."..."..D,..&.
  00000050  32 ae a2 b5 b7 f0 cf d9 0c 85 42 31 89 45 aa 08  2.........B1.E..
  00000060  23 77 d8 63 89 e9 80 98 58 51 ed 3c 3f 75 d7 98  #w.c....XQ.<?u..
  00000070  f3 ce 68 87 77 97 10 9c 0e 54 7f a3 d4 0e a2 37  ..h.w....T.....7
  00000080  d3 93 9c 56 57 d4 9f 15 37 45 56 be 66 a3 2f f6  ...VW...7EV.f./.
  00000090  81 d1 bd 32 11 2e 2f e9 f5 c7 08 e6 96 4e 7c bf  ...2../......N|.
  000000a0  90 62 8b fe b2 a3 df 5f 94 1f 33 20 5b ca 83 c7  .b....._..3 [...
  000000b0  00 11 b4 20 e2 7b cc 07 41 cf 92 71 cc 5e 3b 6f  ... .{..A..q.^;o
  000000c0  6a e4 65 28 49 3b ef d8 0a bc 23 76 63 07 10 4e  j.e(I;....#vc..N
  000000d0  41 8c 79 f7 98 95 a2 e3 e5 be 25 6d c6 06 01 be  A.y.......%m....
  000000e0  19 ae d6 35                                      ...5
Incoming packet #0x9, type 52 / 0x34 (SSH2_MSG_USERAUTH_SUCCESS)
Event Log: Access granted
Event Log: Opening session as main channel
Outgoing packet #0xc, type 90 / 0x5a (SSH2_MSG_CHANNEL_OPEN)
  00000000  00 00 00 07 73 65 73 73 69 6f 6e 00 00 01 00 00  ....session.....
  00000010  00 40 00 00 00 40 00                             .@...@.
Incoming packet #0xa, type 91 / 0x5b (SSH2_MSG_CHANNEL_OPEN_CONFIRMATION)
  00000000  00 00 01 00 00 00 00 00 00 00 00 00 00 00 80 00  ................
Event Log: Opened main channel
Outgoing packet #0xd, type 98 / 0x62 (SSH2_MSG_CHANNEL_REQUEST)
  00000000  00 00 00 00 00 00 00 07 70 74 79 2d 72 65 71 01  ........pty-req.
  00000010  00 00 00 05 78 74 65 72 6d 00 00 00 50 00 00 00  ....xterm...P...
  00000020  18 00 00 00 00 00 00 00 00 00 00 00 10 03 00 00  ................
  00000030  00 7f 80 00 00 96 00 81 00 00 96 00 00           .............
Outgoing packet #0xe, type 98 / 0x62 (SSH2_MSG_CHANNEL_REQUEST)
  00000000  00 00 00 00 00 00 00 05 73 68 65 6c 6c 01        ........shell.
Incoming packet #0xb, type 99 / 0x63 (SSH2_MSG_CHANNEL_SUCCESS)
  00000000  00 00 01 00                                      ....
Event Log: Allocated pty (ospeed 38400bps, ispeed 38400bps)
Incoming packet #0xc, type 93 / 0x5d (SSH2_MSG_CHANNEL_WINDOW_ADJUST)
  00000000  00 00 01 00 00 20 00 00                          ..... ..
Incoming packet #0xd, type 99 / 0x63 (SSH2_MSG_CHANNEL_SUCCESS)
  00000000  00 00 01 00                                      ....
Event Log: Started a shell/command
Incoming packet #0xe, type 94 / 0x5e (SSH2_MSG_CHANNEL_DATA)
  00000000  00 00 01 00 00 00 00 3a 4c 61 73 74 20 6c 6f 67  .......:Last log
  00000010  69 6e 3a 20 54 75 65 20 4f 63 74 20 20 31 20 31  in: Tue Oct  1 1
  00000020  30 3a 32 35 3a 31 33 20 32 30 31 33 20 66 72 6f  0:25:13 2013 fro
  00000030  6d 20 31 39 32 2e 31 36 38 2e 32 2e 32 30 32 0d  m 192.168.2.202.
  00000040  0d 0a                                            ..
Incoming packet #0xf, type 94 / 0x5e (SSH2_MSG_CHANNEL_DATA)
  00000000  00 00 01 00 00 00 00 1e 1b 5b 3f 31 30 33 34 68  .........[?1034h
  00000010  73 65 72 76 65 72 30 31 3a 7e 20 77 65 62 6d 61  server01:~ webma
  00000020  73 74 65 72 24 20                                ster$ 

2 个答案:

答案 0 :(得分:1)

在初始化Net_SFTP之前执行define('NET_SSH2_LOGGING', 2),然后在$sftp->getLog()之前执行exit并发布它所说的内容。

这将提供足够的信息来进行诊断。

答案 1 :(得分:0)

我解决了这个问题,您必须确保该行

set_include_path()

确实指向您的phpseclib / Net目录。

该行:

set_include_path( DIR 。'/ phpseclib /'。PATH_SEPARATOR。get_include_path())

根据php版本,可能无法生成正确的目录。