使用phpseclib SFTP登录时出现Userauth失败

时间:2014-09-03 19:36:07

标签: authentication login phpseclib

我在这里很困惑。我已经运行这个特定的代码超过一年,今天它突然停止工作。我使用phpseclib中的SFTP功能定期将.zip文件上传到服务器,我突然收到错误NET_SSH2_MSG_USERAUTH_FAILURE。

代码如下:

$sftp = new Net_SFTP($sftpURI);
if (!$sftp->login($user, $password)) {
    echo "<pre>" . $sftp->getLog() . "</pre>";
    echo "<pre>" . $sftp->getSFTPLog() . "</pre>";
    exit;
}

$sftp->chdir($inventoryPathName);
$sftp->put("inventory-". $dateStamp . ".zip", $zipPath . "ns_inventory-". $dateStamp . ".zip", NET_SFTP_LOCAL_FILE);

日志输出:

<- 
00000000 53:53:48:2d:32:2e:30:2d:45:78:61:6d:70:6c:65:53 SSH-2.0-ExampleS 
00000010 53:48:44:5f:31:2e:32:2e:33:5f:43:6f:6d:6d:65:6e SHD_1.2.3_Commen 
00000020 74:73:0d:0a ts.. 

-> 
00000000 53:53:48:2d:32:2e:30:2d:70:68:70:73:65:63:6c:69 SSH-2.0-phpsecli 
00000010 62:5f:30:2e:33:20:28:6d:63:72:79:70:74:2c:20:67 b_0.3 (mcrypt, g 
00000020 6d:70:29:0d:0a mp).. 

<- NET_SSH2_MSG_KEXINIT (0.0522s) 
00000000 90:f8:f9:4d:2f:05:2c:3f:e2:32:2a:88:ea:47:f8:46 ...M/.,?.2*..G.F 
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: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:2c:64:69:66:66:69 oup14-sha1,diffi 
00000050 65:2d:68:65:6c:6c:6d:61:6e:2d:67:72:6f:75:70:2d e-hellman-group- 
00000060 65:78:63:68:61:6e:67:65:2d:73:68:61:31:2c:64:69 exchange-sha1,di 
00000070 66:66:69:65:2d:68:65:6c:6c:6d:61:6e:2d:67:72:6f ffie-hellman-gro 
00000080 75:70:2d:65:78:63:68:61:6e:67:65:2d:73:68:61:32 up-exchange-sha2 
00000090 35:36:00:00:00:0f:73:73:68:2d:64:73:73:2c:73:73 56....ssh-dss,ss 
000000a0 68:2d:72:73:61:00:00:00:7e:61:65:73:31:32:38:2d h-rsa...~aes128- 
000000b0 63:62:63:2c:33:64:65:73:2d:63:74:72:2c:61:65:73 cbc,3des-ctr,aes 
000000c0 31:32:38:2d:63:74:72:2c:61:65:73:31:39:32:2d:63 128-ctr,aes192-c 
000000d0 74:72:2c:61:65:73:32:35:36:2d:63:74:72:2c:33:64 tr,aes256-ctr,3d 
000000e0 65:73:2d:63:62:63:2c:62:6c:6f:77:66:69:73:68:2d es-cbc,blowfish- 
000000f0 63:62:63:2c:61:65:73:31:39:32:2d:63:62:63:2c:61 cbc,aes192-cbc,a 
00000100 65:73:32:35:36:2d:63:62:63:2c:61:72:63:66:6f:75 es256-cbc,arcfou 
00000110 72:2c:61:72:63:66:6f:75:72:31:32:38:2c:61:72:63 r,arcfour128,arc 
00000120 66:6f:75:72:32:35:36:00:00:00:7e:61:65:73:31:32 four256...~aes12 
00000130 38:2d:63:62:63:2c:33:64:65:73:2d:63:74:72:2c:61 8-cbc,3des-ctr,a 
00000140 65:73:31:32:38:2d:63:74:72:2c:61:65:73:31:39:32 es128-ctr,aes192 
00000150 2d:63:74:72:2c:61:65:73:32:35:36:2d:63:74:72:2c -ctr,aes256-ctr, 
00000160 33:64:65:73:2d:63:62:63:2c:62:6c:6f:77:66:69:73 3des-cbc,blowfis 
00000170 68:2d:63:62:63:2c:61:65:73:31:39:32:2d:63:62:63 h-cbc,aes192-cbc 
00000180 2c:61:65:73:32:35:36:2d:63:62:63:2c:61:72:63:66 ,aes256-cbc,arcf 
00000190 6f:75:72:2c:61:72:63:66:6f:75:72:31:32:38:2c:61 our,arcfour128,a 
000001a0 72:63:66:6f:75:72:32:35:36:00:00:00:4b:68:6d:61 rcfour256...Khma 
000001b0 63:2d:6d:64:35:2c:68:6d:61:63:2d:73:68:61:31:2c c-md5,hmac-sha1, 
000001c0 68:6d:61:63:2d:6d:64:35:2d:39:36:2c:68:6d:61:63 hmac-md5-96,hmac 
000001d0 2d:73:68:61:31:2d:39:36:2c:68:6d:61:63:2d:73:68 -sha1-96,hmac-sh 
000001e0 61:32:35:36:2c:68:6d:61:63:2d:73:68:61:32:35:36 a256,hmac-sha256 
000001f0 40:73:73:68:2e:63:6f:6d:00:00:00:4b:68:6d:61:63 @ssh.com...Khmac 
00000200 2d:6d:64:35:2c:68:6d:61:63:2d:73:68:61:31:2c:68 -md5,hmac-sha1,h 
00000210 6d:61:63:2d:6d:64:35:2d:39:36:2c:68:6d:61:63:2d mac-md5-96,hmac- 
0000-md5-96,hmac- 
00000220 73:68:61:31:2d:39:36:2c:68:6d:61:63:2d:73:68:61 sha1-96,hmac-sha 
00000230 32:35:36:2c:68:6d:61:63:2d:73:68:61:32:35:36:40 256,hmac-sha256@ 
00000240 73:73:68:2e:63:6f:6d:00:00:00:09:6e:6f:6e:65:2c ssh.com....none, 
00000250 7a:6c:69:62:00:00:00:09:6e:6f:6e:65:2c:7a:6c:69 zlib....none,zli 
00000260 62:00:00:00:00:00:00:00:00:00:00:00:00:00 b............. 

-> NET_SSH2_MSG_KEXINIT (0s) 
00000000 66:7a:67:34:41:bb:a0:08:8a:1b:31:0e:a3:c5:9c:7b fzg4A.....1....{ 
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 76:61:72:63:66:6f:75:72:32:35:36:2c:61:72:63:66 varcfour256,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:62:63:2c:61:65:73:31:39:32 es128-cbc,aes192 
00000090 2d:63:62:63:2c:61:65:73:32:35:36:2d:63:62:63:2c -cbc,aes256-cbc, 
000000a0 61:65:73:31:32:38:2d:63:74:72:2c:61:65:73:31:39 aes128-ctr,aes19 
000000b0 32:2d:63:74:72:2c:61:65:73:32:35:36:2d:63:74:72 2-ctr,aes256-ctr 
000000c0 2c:33:64:65:73:2d:63:74:72:2c:33:64:65:73:2d:63 ,3des-ctr,3des-c 
000000d0 62:63:2c:6e:6f:6e:65:00:00:00:76:61:72:63:66:6f bc,none...varcfo 
000000e0 75:72:32:35:36:2c:61:72:63:66:6f:75:72:31:32:38 ur256,arcfour128 
000000f0 2c:61:72:63:66:6f:75:72:2c:61:65:73:31:32:38:2d ,arcfour,aes128- 
00000100 63:62:63:2c:61:65:73:31:39:32:2d:63:62:63:2c:61 cbc,aes192-cbc,a 
00000110 65:73:32:35:36:2d:63:62:63:2c:61:65:73:31:32:38 es256-cbc,aes128 
00000120 2d:63:74:72:2c:61:65:73:31:39:32:2d:63:74:72:2c -ctr,aes192-ctr, 
00000130 61:65:73:32:35:36:2d:63:74:72:2c:33:64:65:73:2d aes256-ctr,3des- 
00000140 63:74:72:2c:33:64:65:73:2d:63:62:63:2c:6e:6f:6e ctr,3des-cbc,non 
00000150 65:00:00:00:30:68:6d:61:63:2d:73:68:61:31:2d:39 e...0hmac-sha1-9 
00000160 36:2c:68:6d:61:63:2d:73:68:61:31:2c:68:6d:61:63 6,hmac-sha1,hmac 
00000170 2d:6d:64:35:2d:39:36:2c:68:6d:61:63:2d:6d:64:35 -md5-96,hmac-md5 
00000180 2c:6e:6f:6e:65:00:00:00:30:68:6d:61:63:2d:73:68 ,none...0hmac-sh 
00000190 61:31:2d:39:36:2c:68:6d:61:63:2d:73:68:61:31:2c a1-96,hmac-sha1, 
000001a0 68:6d:61:63:2d:6d:64:35:2d:39:36:2c:68:6d:61:63 hmac-md5-96,hmac 
000001b0 2d:6d:64:35:2c:6e:6f:6e:65:00:00:00:04:6e:6f:6e -md5,none....non 
000001c0 65:00:00:00:04:6e:6f:6e:65:00:00:00:00:00:00:00 e....none....... 
000001d0 00:00:00:00:00:00 ...... 

-> NET_SSH2_MSG_KEXDH_INIT (0s) 
00000000 00:00:00:81:00:fe:b3:2a:f3:ad:79:2d:12:8e:f2:57 .......*..y-...W 
00000010 69:f9:65:c3:b7:08:37:a9:30:83:16:2f:cb:5e:3b:e0 i.e...7.0../.^;. 
00000020 60:73:c3:b0:3e:d5:0a:85:16:28:70:67:37:8a:a4:b3 `s..>....(pg7... 
00000030 07:1d:bb:42:5b:ac:ca:eb:2a:fc:fc:ea:72:ed:c5:14 ...B[...*...r... 
00000040 fe:89:89:c3:72:54:5f:1c:7e:42:12:0c:50:66:0d:2c ....rT_.~B..Pf., 
00000050 5d:3d:32:7e:64:87:7c:8f:54:8a:d5:cd:64:e1:1a:58 ]=2~d.|.T...d..X 
00000060 c5:ac:10:9e:89:9b:b2:20:e7:6f:23:cd:8c:80:b1:b0 ....... .o#..... 
00000070 a1:3d:1a:6d:23:38:9c:df:bc:c0:a3:54:fa:59:57:0f .=.m#8.....T.YW. 
00000080 08:5a:7c:4d:70 .Z|Mp 

<- NET_SSH2_MSG_KEXDH_REPLY (0.1044s) 
00000000 00:00:00:97:00:00:00:07:73:73:68:2d:72:73:61:00 ........ssh-rsa. 
00000010 00:00:03:01:00:01:00:00:00:81:00:ad:46:7f:46:ed ............F.F. 
00000020 59:95:74:15:57:f6:15:9b:06:7b:02:a0:21:a3:52:eb Y.t.W....{..!.R. 
00000030 b9:f6:cf:eb:cc:9a:e2:b4:75:04:a1:3d:5a:af:a6:50 ........u..=Z..P 
00000040 a5:f1:b7:88:d5:1b:c2:de:ea:33:86:78:c8:09:5e:66 .........3.x..^f 
00000050 22:e0:b2:35:e2:c0:b9:ef:74:ab:7a:c0:6f:22:474:ab:7a:c0:6f:22:47:00 "..5....t.z.o"G. 
00000060 eb:8b:fb:62:24:f1:01:80:72:ae:ff:22:2f:ed:02:26 ...b$...r.."/..& 
00000070 34:ac:8b:0f:cd:be:db:54:a6:87:f9:59:db:3.Y.5.. 
00000080 b1:46:20:7e:63:ef:3d:0f:a8:09:e4:cc:ef:cc:a3:0b .F ~c.=......... 
00000090 35:66:a9:59:71:d0:a0:9e:e2:15:75:00:00:00:81:00 5f.Yq.....u..... 
000000a0 de:14:bc:cc:e9:71:29:54:65:ce:e1:c7:70:b7:d3:e4 .....q)Te...p... 
000000b0 43:12:43:1a:47:89:bb:04:5d:0b:1d:a4:ff:2b:88:2a C.C.G...]....+.* 
000000c0 e6:9a:18:2d:fc:be:0d:0b:9c:9f:aa:0a:32:18:dc:08 ...-........2... 
000000d0 4e:00:60:bc:c2:bd:93:3d:fd:4a:f9:fe:9b:a2:de:e9 N.`....=.J...... 
000000e0 e3:16:81:58:e5:93:0f:c5:3b:4a:88:dd:1b:43:d8:85 ...X....;J...C.. 
000000f0 d3:48:57:6f:09:ca:e7:f8:29:d9:42:df:7c:bd:c0:ce .HWo....).B.|... 
00000100 6c:e7:39:32:2b:35:97:86:e5:ec:51:70:c5:f5:64:65 l.92+5....Qp..de 
00000110 df:f9:a8:fd:22:8e:64:ec:99:6d:61:97:19:b5:0f:8e ....".d..ma..... 
00000120 00:00:00:8f:00:00:00:07:73:73:68:2d:72:73:61:00 ........ssh-rsa. 
00000130 00:00:80:09:c5:60:f7:8e:03:e6:31:35:9e:1e:49:19 .....`....15..I. 
00000140 2f:a1:ef:4a:44:96:08:50:f2:15:e9:db:9a:35:c6:cc /..JD..P.....5.. 
00000150 af:4f:a5:a8:61:a2:c9:6f:62:39:0c:0c:fc:e2:c3:2d .O..a..ob9.....- 
00000160 30:63:ce:e9:e1:b2:2c:f3:e5:4e:01:7a:f4:5c:71:f0 0c....,..N.z.\q. 
00000170 94:2f:36:a7:68:1c:8e:87:2a:da:cd:95:ad:75:6e:3b ./6.h...*....un; 
00000180 ab:bc:04:59:81:ac:0b:3e:88:bb:be:51:e0:56:d7:07 ...Y...>...Q.V.. 
00000190 b5:e1:86:47:d3:38:a3:86:63:dd:69:77:f3:01:eb:70 ...G.8..c.iw...p 
000001a0 84:51:49:ef:05:e9:20:1f:36:03:5e:70:b4:17:f2:98 .QI... .6.^p.... 
000001b0 a8:5c:7f .\. 

-> NET_SSH2_MSG_NEWKEYS (0.0001s) 


<- NET_SSH2_MSG_NEWKEYS (0s) 


-> NET_SSH2_MSG_SERVICE_REQUEST (0.0001s) 
00000000 00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74:68 ....ssh-userauth 

<- NET_SSH2_MSG_SERVICE_ACCEPT (0.1004s) 
00000000 00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74:68 ....ssh-userauth 

-> NET_SSH2_MSG_USERAUTH_REQUEST (0.0001s) 
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 

<- NET_SSH2_MSG_USERAUTH_FAILURE (0.1549s) 
00000000 00:00:00:27:70:61:73:73:77:6f:72:64:2c:70:75:62 ...'password,pub 
00000010 6c:69:63:6b:65:79:2c:6b:65:79:62:6f:61:72:64:2d lickey,keyboard- 
00000020 69:6e:74:65:72:61:63:74:69:76:65:00 interactive. 

-> NET_SSH2_MSG_USERAUTH_REQUEST (0.0001s) 
00000000 00:00:00:0c:67:65:6f:72:67:65:73:6d:75:73:69:63 ....georgesmusic 
00000010 00:00:00:0e:73:73:68:2d:63:6f:6e:6e:65:63:74:69 ....ssh-connecti 
00000020 6f:6e:00:00:00:14:6b:65:79:62:6f:61:72:64:2d:69 on....keyboard-i 
00000030 6e:74:65:72:61:63:74:69:76:65:00:00:00:00:00:00 nteractive...... 
00000040 00:00 .. 

<- NET_SSH2_MSG_USERAUTH_INFO_REQUEST (60) (0.0521s) 
00000000 00:00:00:08:70:61:73:73:77:6f:72:64:00:00:00:1f ....password.... 
00000010 45:6e:74:65:72:20:70:61:73:73:77:6f:72:64:20:66 Enter password f 
00000020 6f:72:20:67:65:6f:72:67:65:73:6d:75:73:69:63:00 or georgesmusic. 
00000030 00:00:00:00:00:00:01:00:00:00:09:50:61:73:73:77 ...........Passw 
00000040 6f:72:64:3a:00 ord:. 

-> NET_SSH2_MSG_USERAUTH_INFO_RESPONSE (61) (0.0009s) 
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 

<- NET_SSH2_MSG_USERAUTH_FAILURE (0.0704s) 
00000000 00:00:00:27:70:61:73:73:77:6f:72:64:2c:70:75:62 ...'password,pub 
00000010 6c:69:63:6b:65:79:2c:6b:65:79:62:6f:61:72:64:2d lickey,keyboard- 
00000020 69:6e:74:65:72:61:63:74:69:76:65:00 interactive. 

0 个答案:

没有答案