Login fails

Get help with using the PHP Secure Communications Library.

Moderator: Nuxius

Forum rules
The purpose of this forum is to provide support for phpseclib, a pure PHP SSH / SFTP / RSA library.

Posts by new users are held in a moderation queue and are not publicly visible until the post is approved.

Login fails

Postby thoward » Wed May 02, 2012 7:02 pm

No luck connecting to localhost or any other IP...
The user and password info is correct and I can use Putty to connect.

I would be grateful for any help...

Code: Select all
<?php
include('Net/SSH2.php');
define('NET_SSH2_LOGGING', NET_SSH2_LOG_COMPLEX);

$ssh = new Net_SSH2('127.0.0.1');
echo "Server Ident = " . $ssh->getServerIdentification() . "<br/>";
echo "Public Host Key = " . $ssh->getServerPublicHostKey() . "<br/><br/>";

if (!$ssh->login('newuser', '123abc')) {
   echo $ssh->getLog() . "<br/>";
   exit('Login Failed');
}

echo $ssh->exec('pwd');
echo $ssh->exec('ls -la');
?>



Server Ident = SSH-1.99-OpenSSH_5.2
Public Host Key = ssh-rsa#Ô¾ÁYoa®(t#εí%]eìÝ—Ì3Wr½LýnóØTø@@|åå®Rêèi‘xA?L”®Iã¸pᕼ ýË©KŠ, 'YL$¾Óo_ƒF.SÍHÏA*©I¦åG2S&ºh<¿ÝÓdõ_¦Æß%ØóbSž—µ »©ãsœç»4ù"gxxUvÝUúÛD•’q$MâÂi*Õ*Ü¿ “à^óÖˆb)á&¸Æ_²’ïí¤37v.2Çú–/†Ä b 2“øsUI󑳝 RMŠpØ@˜{ª[¿…—:Í»sáË[OñW#

<- 00000000 53:53:48:2d:31:2e:39:39:2d:4f:70:65:6e:53:53:48 SSH-1.99-OpenSSH 00000010 5f:35:2e:32:0a _5.2. -> 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:32:20:28:6d:63:72:79:70:74:2c:20:67 b_0.2 (mcrypt, g 00000020 6d:70:29:0d:0a mp).. <- NET_SSH2_MSG_KEXINIT (0s) 00000000 a6:2b:61:fc:5e:76:6b:0c:64:dd:d8:de:7e:69:ea:e0 .+a.^vk.d...~i.. 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............. -> NET_SSH2_MSG_KEXINIT (0s) 00000000 fd:22:89:41:81:24:41:90:55:a0:1a:95:05:81:df:04 .".A.$A.U....... 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:80:77:13:5e:e9:a4:52:6e:6d:c9:06:d5:9c ....w.^..Rnm.... 00000010 5a:d7:04:91:e2:fa:e2:c3:f9:fd:a9:c0:93:82:c2:35 Z..............5 00000020 87:52:c8:57:2d:84:86:af:2e:6a:ab:b5:15:5d:ea:7a .R.W-....j...].z 00000030 68:4c:7f:8f:75:bd:c0:29:dc:23:92:0e:e1:d2:74:aa hL..u..).#....t. 00000040 2e:51:73:8c:63:c1:a0:5f:80:a9:84:a1:70:ab:eb:fb .Qs.c.._....p... 00000050 f3:1e:2b:b9:c0:47:a9:8e:58:15:5d:0e:69:c9:b9:b7 ..+..G..X.].i... 00000060 e2:4c:6e:6f:a0:eb:87:34:b0:28:f2:79:34:a2:f8:c7 .Lno...4.(.y4... 00000070 88:8a:35:3e:8c:29:a3:da:fa:4e:fc:b2:ea:f5:04:b8 ..5>.)...N...... 00000080 62:2a:94:eb b*.. <- NET_SSH2_MSG_KEXDH_REPLY (0.2083s) 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:d4:be:c1:59:6f:61:ae ...#........Yoa. 00000020 28:04:74:23:ce:12:b5:ed:02:25:5d:65:02:ec:dd:97 (.t#.....%]e.... 00000030 cc:7f:33:08:57:72:bd:4c:03:fd:6e:f3:d8:54:f8:40 ..3.Wr.L..n..T.@ 00000040 40:14:90:7c:e5:e5:ae:52:ea:e8:69:03:7f:91:78:41 @..|...R..i...xA 00000050 3f:4c:94:ae:49:e3:b8:70:e1:95:bc:0d:fd:cb:18:14 ?L..I..p........ 00000060 a9:4b:8a:2c:a0:08:27:59:4c:24:be:d3:6f:5f:0f:83 .K.,..'YL$..o_.. 00000070 8f:46:2e:53:cd:48:cf:41:2a:a9:49:a6:e5:47:32:53 .F.S.H.A*.I..G2S 00000080 1b:26:04:ba:10:68:9d:81:3c:bf:dd:d3:64:f5:5f:00 .&...h......d._. 00000090 a6:c6:df:25:d8:f3:62:53:9e:97:b5:20:bb:a9:8d:e3 ...%..bS... .... 000000a0 73:9c:e7:81:bb:34:f9:22:67:19:78:78:55:12:76:dd s....4."g.xxU.v. 000000b0 55:fa:db:44:95:92:71:24:4d:e2:c2:69:17:2a:14:0e U..D..q$M..i.*.. 000000c0 d5:2a:dc:15:bf:0b:93:e0:5e:f3:d6:88:62:29:e1:26 .*......^...b).& 000000d0 b8:c6:16:5f:b2:92:ef:ed:a4:33:37:76:2e:00:32:18 ..._.....37v..2. 000000e0 10:c7:19:fa:90:96:2f:86:c4:20:a0:62:20:32:93:03 ....../.. .b 2.. 000000f0 f8:73:55:07:49:cf:83:91:b3:9d:a0:0e:18:52:4d:1f .sU.I........RM. 00000100 8a:05:70:d8:40:98:7b:aa:5b:bf:85:97:1a:3a:cd:bb ..p.@.{.[....:.. 00000110 73:e1:cb:5b:19:4f:f1:57:23:00:00:00:81:00:f7:90 s..[.O.W#....... 00000120 6f:81:d4:68:21:df:de:46:26:40:c5:0b:24:e1:9e:e3 o..h!..F&@..$... 00000130 12:d4:7f:dd:6b:fb:dc:06:a9:3d:a7:e2:00:78:a8:e0 ....k....=...x.. 00000140 1d:80:dc:44:cf:59:67:82:80:df:d9:a0:62:d5:f0:84 ...D.Yg.....b... 00000150 e7:d6:a1:b9:9d:75:70:d7:a1:5d:e9:e9:50:c0:29:4d .....up..]..P.)M 00000160 f8:e9:d3:68:e6:c5:2d:d3:f2:e7:f8:a5:1d:a5:3c:28 ...h..-........( 00000170 53:a8:3c:4b:3b:ac:fe:12:9d:3d:e2:32:4b:c8:e9:eb S..K;....=.2K... 00000180 b9:a9:65:1c:c1:be:c9:63:b0:92:bb:c0:75:38:74:90 ..e....c....u8t. 00000190 96:96:60:9e:2c:76:92:33:cb:ed:89:2c:ef:bb:00:00 ..`.,v.3...,.... 000001a0 01:0f:00:00:00:07:73:73:68:2d:72:73:61:00:00:01 ......ssh-rsa... 000001b0 00:8c:a6:b9:3f:24:f9:2d:fc:ec:fb:4e:71:a5:2a:8d ....?$.-...Nq.*. 000001c0 d5:4e:d4:0f:3b:6e:9a:88:d9:8f:30:93:f9:81:26:da .N..;n....0...&. 000001d0 06:23:e4:26:69:05:f8:2d:0b:61:27:27:11:e8:30:17 .#.&i..-.a''..0. 000001e0 5f:45:de:c2:09:99:ef:71:8d:cb:61:77:98:da:cd:3a _E.....q..aw...: 000001f0 1e:8f:e3:60:cd:bc:e7:74:ee:60:d3:9b:5f:7b:7d:ab ...`...t.`.._{}. 00000200 ab:e6:d8:9a:fd:2c:32:a5:c6:c6:1f:88:39:ff:60:9f .....,2.....9.`. 00000210 3f:02:b0:53:c5:c6:fd:ed:c6:b8:d0:60:f5:af:c7:d4 ?..S.......`.... 00000220 65:54:96:29:b3:e8:55:10:a0:58:cd:59:64:75:35:32 eT.)..U..X.Ydu52 00000230 76:d1:69:7b:11:0a:7f:83:15:3a:c4:c0:1a:d9:86:76 v.i{.....:.....v 00000240 ab:b6:b5:29:a9:75:af:35:85:7d:22:85:22:51:5d:92 ...).u.5.}"."Q]. 00000250 17:b6:f4:3e:d3:88:92:92:8a:eb:31:a7:26:25:fc:7e ...>......1.&%.~ 00000260 cf:69:cf:79:40:b1:90:2d:6f:a7:bd:0e:3d:87:ad:26 .i.y@..-o...=..& 00000270 6f:d2:63:92:fb:98:79:b2:e2:c5:1b:ea:a1:03:b5:d6 o.c...y......... 00000280 ae:d1:3e:d9:cf:24:4c:98:84:67:3e:35:ea:d3:42:1c ..>..$L..g>5..B. 00000290 be:79:90:78:0a:94:87:58:ec:49:33:57:7d:f6:b5:4a .y.x...X.I3W}..J 000002a0 de:40:8b:a1:cf:a9:06:d5:c8:4e:37:7a:ed:6b:22:3d .@.......N7z.k"= 000002b0 24 $ -> NET_SSH2_MSG_NEWKEYS (0.0001s) <- NET_SSH2_MSG_NEWKEYS (0s) -> NET_SSH2_MSG_SERVICE_REQUEST (0s) 00000000 00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74:68 ....ssh-userauth
Login Failed

Apache Error Log....
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_module_open() [<a href='function.mcrypt-module-open'>function.mcrypt-module-open</a>]: Could not open encryption module in /opt/freeware/share/pear/Crypt/RC4.php on line 327
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_generic_init() expects parameter 1 to be resource, boolean given in /opt/freeware/share/pear/Crypt/RC4.php on line 328
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_generic() expects parameter 1 to be resource, boolean given in /opt/freeware/share/pear/Crypt/RC4.php on line 332
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_module_open() [<a href='function.mcrypt-module-open'>function.mcrypt-module-open</a>]: Could not open encryption module in /opt/freeware/share/pear/Crypt/RC4.php on line 327
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_generic_init() expects parameter 1 to be resource, boolean given in /opt/freeware/share/pear/Crypt/RC4.php on line 328
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_generic() expects parameter 1 to be resource, boolean given in /opt/freeware/share/pear/Crypt/RC4.php on line 332
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_module_open() [<a href='function.mcrypt-module-open'>function.mcrypt-module-open</a>]: Could not open encryption module in /opt/freeware/share/pear/Crypt/RC4.php on line 327
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_generic_init() expects parameter 1 to be resource, boolean given in /opt/freeware/share/pear/Crypt/RC4.php on line 328
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_generic() expects parameter 1 to be resource, boolean given in /opt/freeware/share/pear/Crypt/RC4.php on line 332
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_module_open() [<a href='function.mcrypt-module-open'>function.mcrypt-module-open</a>]: Could not open encryption module in /opt/freeware/share/pear/Crypt/RC4.php on line 327
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_generic_init() expects parameter 1 to be resource, boolean given in /opt/freeware/share/pear/Crypt/RC4.php on line 328
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_generic() expects parameter 1 to be resource, boolean given in /opt/freeware/share/pear/Crypt/RC4.php on line 332
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: unpack() [<a href='function.unpack'>function.unpack</a>]: Type N: not enough input, need 4, have 0 in /opt/freeware/share/pear/Net/SSH2.php on line 1870
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: extract() expects parameter 1 to be array, boolean given in /opt/freeware/share/pear/Net/SSH2.php on line 1870
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Notice: Invalid HMAC in /opt/freeware/share/pear/Net/SSH2.php on line 1890
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Notice: Connection closed by server in /opt/freeware/share/pear/Net/SSH2.php on line 1325
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_module_open() [<a href='function.mcrypt-module-open'>function.mcrypt-module-open</a>]: Could not open encryption module in /opt/freeware/share/pear/Crypt/RC4.php on line 327
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_generic_init() expects parameter 1 to be resource, boolean given in /opt/freeware/share/pear/Crypt/RC4.php on line 328
[Wed May 02 13:57:31 2012] [error] [client 10.163.151.39] PHP Warning: mcrypt_generic() expects parameter 1 to be resource, boolean given in /opt/freeware/share/pear/Crypt/RC4.php on line 332
thoward
Traveler
 
Posts: 3
Joined: Wed May 02, 2012 6:53 pm

Re: Login fails

Postby TerraFrost » Thu May 03, 2012 6:10 am

What does the following program give you as output?:

Code: Select all
<?php
print_r(mcrypt_list_algorithms(''));
TerraFrost
Legendary Guard
 
Posts: 12218
Joined: Wed Dec 04, 2002 6:37 am

Re: Login fails

Postby thoward » Mon May 07, 2012 2:25 pm

Array ( )
thoward
Traveler
 
Posts: 3
Joined: Wed May 02, 2012 6:53 pm

Re: Login fails

Postby TerraFrost » Wed May 09, 2012 10:04 am

After including Net/SSH2.php do this:

define('CRYPT_RC4_MODE', CRYPT_RC4_MODE_INTERNAL);
TerraFrost
Legendary Guard
 
Posts: 12218
Joined: Wed Dec 04, 2002 6:37 am

Re: Login fails

Postby thoward » Wed May 09, 2012 12:39 pm

Thank you for your help. I have it working. Here is what I did.

After discovering that phpseclib was looking for the libmcrypt algorithms, I noticed that the phpinfo() for mcrypt was showing "Supported ciphers none" and "Supported modes none". I tried rebuilding libmcrypt and php using the suggestions I found on google, but I could never get PHP to load them under AIX 5.3.

Since phpseclib uses them if they are present, I uninstalled libmcrypt and re-built PHP.

I then tried to use Pear to re-install phpseclib, but I kept getting errors like the following:
Starting to download Net_SSH2-0.2.2.tgz (18,768 bytes)
......done: 18,768 bytes
could not extract the package.xml file from "/tmp/pear/download/Net_SSH2-0.2.2.tgz"
Download of "phpseclib/Net_SSH2" succeeded, but it is not a valid package archive
Error: cannot download "phpseclib/Net_SSH2"


So, I just downloaded the files and manually installed them and everything is working now.

I have not tried define('CRYPT_RC4_MODE', CRYPT_RC4_MODE_INTERNAL); but I suppose it would have overridden the libmcrypt implementation.

Thanks again...
thoward
Traveler
 
Posts: 3
Joined: Wed May 02, 2012 6:53 pm

Re: Login fails

Postby TerraFrost » Mon May 14, 2012 1:31 am

Hmmm - I don't know what's up with PEAR.

That said, I did just commit a fix that'll make the symmetric key algorithms work even if mcrypt_list_algorithms('') returns nothing.

I didn't do that initially figuring people could change the algorithm path after the objects initial initialization on successive mcrypt_module_open() calls (the first two parameters let you set the path). But apparently my code's support of that wasn't as expansive as I thought and I don't imagine anyone would use that feature anyway.
TerraFrost
Legendary Guard
 
Posts: 12218
Joined: Wed Dec 04, 2002 6:37 am


Return to phpseclib support

Who is online

Users browsing this forum: No registered users and 0 guests