Trouble connecting to Cisco asr 9000

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.

Trouble connecting to Cisco asr 9000

Postby bferk » Wed Aug 21, 2013 7:02 pm

I am using phpseclib to try and connect to a Cisco ASR 9000, but I am having trouble logging into the device with this code
Code: Select all
    if(!$nKCon->login($nKUser,$nKPass)){
        print_r($nKCon->getLog()."<br>");
        print_r($nKCon->getErrors());
        exit('Login Failed'); 
       
    } else {       
        echo 'Connected <br>';
}
Am I missing some code?
Whenever I run it, it fails to log in and I have gotten this message from the getErrors() method
SSH_MSG_DISCONNECT: NET_SSH2_DISCONNECT_BY_APPLICATION

I have also got the logs from the code and they look like this
00000000 53:53:48:2d:31:2e:39:39:2d:43:69:73:63:6f:2d:32 SSH-1.99-Cisco-2 00000010 2e:30:0a .0. -> 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:62 b_0.3 (mcrypt, b 00000020 63:6d:61:74:68:29:0d:0a cmath).. <- NET_SSH2_MSG_KEXINIT (since last: 0.051, network: 0.005s) 00000000 62:76:6d:f6:ca:16:9e:50:9f:08:7b:4a:9d:79:f0:d2 bvm....P..{J.y.. 00000010 00:00:00:1a: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:00:00 an-group1-sha1.. 00000030 00:07:73:73:68:2d:72:73:61:00:00:00:29:61:65:73 ..ssh-rsa...)aes 00000040 31:32:38:2d:63:62:63:2c:61:65:73:31:39:32:2d:63 128-cbc,aes192-c 00000050 62:63:2c:61:65:73:32:35:36:2d:63:62:63:2c:33:64 bc,aes256-cbc,3d 00000060 65:73:2d:63:62:63:00:00:00:29:61:65:73:31:32:38 es-cbc...)aes128 00000070 2d:63:62:63:2c:61:65:73:31:39:32:2d:63:62:63:2c -cbc,aes192-cbc, 00000080 61:65:73:32:35:36:2d:63:62:63:2c:33:64:65:73:2d aes256-cbc,3des- 00000090 63:62:63:00:00:00:12:68:6d:61:63:2d:6d:64:35:2c cbc....hmac-md5, 000000a0 68:6d:61:63:2d:73:68:61:31:00:00:00:12:68:6d:61 hmac-sha1....hma 000000b0 63:2d:6d:64:35:2c:68:6d:61:63:2d:73:68:61:31:00 c-md5,hmac-sha1. 000000c0 00:00:04:6e:6f:6e:65:00:00:00:04:6e:6f:6e:65:00 ...none....none. 000000d0 00:00:00:00:00:00:00:00:00:00:00:00 ............ -> NET_SSH2_MSG_KEXINIT (since last: 0.014, network: 0s) 00000000 ad:4e:12:92:6c:77:4b:2d:59:45:c3:ed:38:cc:2b:22 .N..lwK-YE..8.+" 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 74:77:6f:66:69:73:68:31:32:38:2d:63:74:72:2c:74 twofish128-ctr,t 000000b0 77:6f:66:69:73:68:31:39:32:2d:63:74:72:2c:74:77 wofish192-ctr,tw 000000c0 6f:66:69:73:68:32:35:36:2d:63:74:72:2c:61:65:73 ofish256-ctr,aes 000000d0 31:32:38:2d:63:62:63:2c:61:65:73:31:39:32:2d:63 128-cbc,aes192-c 000000e0 62:63:2c:61:65:73:32:35:36:2d:63:62:63:2c:74:77 bc,aes256-cbc,tw 000000f0 6f:66:69:73:68:31:32:38:2d:63:62:63:2c:74:77:6f ofish128-cbc,two 00000100 66:69:73:68:31:39:32:2d:63:62:63:2c:74:77:6f:66 fish192-cbc,twof 00000110 69:73:68:32:35:36:2d:63:62:63:2c:74:77:6f:66:69 ish256-cbc,twofi 00000120 73:68:2d:63:62:63:2c:62:6c:6f:77:66:69:73:68:2d sh-cbc,blowfish- 00000130 63:74:72:2c:62:6c:6f:77:66:69:73:68:2d:63:62:63 ctr,blowfish-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:74:77:6f:66:69:73 es256-ctr,twofis 000001a0 68:31:32:38:2d:63:74:72:2c:74:77:6f:66:69:73:68 h128-ctr,twofish 000001b0 31:39:32:2d:63:74:72:2c:74:77:6f:66:69:73:68:32 192-ctr,twofish2 000001c0 35:36:2d:63:74:72:2c:61:65:73:31:32:38:2d:63:62 56-ctr,aes128-cb 000001d0 63:2c:61:65:73:31:39:32:2d:63:62:63:2c:61:65:73 c,aes192-cbc,aes 000001e0 32:35:36:2d:63:62:63:2c:74:77:6f:66:69:73:68:31 256-cbc,twofish1 000001f0 32:38:2d:63:62:63:2c:74:77:6f:66:69:73:68:31:39 28-cbc,twofish19 00000200 32:2d:63:62:63:2c:74:77:6f:66:69:73:68:32:35:36 2-cbc,twofish256 00000210 2d:63:62:63:2c:74:77:6f:66:69:73:68:2d:63:62:63 -cbc,twofish-cbc 00000220 2c:62:6c:6f:77:66:69:73:68:2d:63:74:72:2c:62:6c ,blowfish-ctr,bl 00000230 6f:77:66:69:73:68:2d:63:62:63:2c:33:64:65:73:2d owfish-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 ...... -> NET_SSH2_MSG_KEXDH_INIT (since last: 0.038, network: 0s) 00000000 00:00:00:80:4d:15:92:39:89:a3:7e:81:09:90:a4:32 ....M..9..~....2 00000010 7c:ec:5e:bf:3c:fc:8e:39:d3:3e:8f:9c:a0:00:f5:ea |.^....9.>...... 00000020 d4:5b:a9:c1:92:68:2b:03:a9:c6:87:4c:a0:22:b5:19 .[...h+....L.".. 00000030 6d:ad:6d:91:9d:5b:49:a6:fd:c9:11:1f:b0:ac:c3:1c m.m..[I......... 00000040 72:b0:ca:dc:8f:e8:71:ec:6b:43:d1:62:3f:06:71:ae r.....q.kC.b?.q. 00000050 5b:81:cb:26:d5:09:c0:17:51:ff:35:0a:35:9e:e8:d6 [..&....Q.5.5... 00000060 ba:da:f9:c6:1f:49:3c:4a:19:91:e3:83:22:ec:23:66 .....I.J....".#f 00000070 87:d0:23:c1:44:5b:36:00:0a:f0:83:95:45:08:9e:56 ..#.D[6.....E..V 00000080 d5:f8:33:e9 ..3. <- NET_SSH2_MSG_KEXDH_REPLY (since last: 0.263, network: 0.262s) 00000000 00:00:01:17:00:00:00:07:73:73:68:2d:72:73:61:00 ........ssh-rsa. 00000010 00:00:03:01:00:01:00:00:01:01:00:b9:fa:f6:be:c2 ................ 00000020 00:3d:77:b6:f7:c1:75:86:1c:8f:ac:7d:06:5a:79:92 .=w...u....}.Zy. 00000030 f5:ec:ff:06:4f:24:1b:14:3b:31:c3:0e:76:9a:03:af ....O$..;1..v... 00000040 1e:60:bd:35:f1:37:29:f1:c2:6b:59:dd:0b:b3:e0:47 .`.5.7)..kY....G 00000050 fd:3e:1a:e4:a9:46:d1:fb:52:83:07:d8:2d:6b:a8:94 .>...F..R...-k.. 00000060 c1:cf:a7:db:0f:f3:06:ba:89:34:0a:57:c0:54:82:58 .........4.W.T.X 00000070 2a:89:e0:f3:d8:70:e0:1e:7e:d1:95:23:ef:d7:33:eb *....p..~..#..3. 00000080 d2:46:bb:bd:fa:1c:8c:c7:d9:4d:60:29:fb:9e:50:c9 .F.......M`)..P. 00000090 94:5a:c8:c4:7b:a0:e7:6c:1a:eb:8f:24:ef:4e:7b:f8 .Z..{..l...$.N{. 000000a0 7d:f6:c3:b1:74:1c:66:70:6d:23:eb:2f:fd:3e:4f:4a }...t.fpm#./.>OJ 000000b0 00:ac:47:97:4f:bf:24:a9:a4:ba:e2:61:85:a0:17:75 ..G.O.$....a...u 000000c0 a5:fa:04:d4:6e:fb:e1:a9:07:c2:37:55:3a:27:75:17 ....n.....7U:'u. 000000d0 da:37:db:10:d3:77:e3:e7:61:6c:98:09:70:b5:bb:cb .7...w..al..p... 000000e0 b8:c5:c5:68:c4:72:69:ca:cf:cf:16:69:a3:e7:97:25 ...h.ri....i...% 000000f0 c2:bb:cf:6d:71:b8:d0:da:e4:e8:09:52:a9:ff:fd:8b ...mq......R.... 00000100 d3:5e:58:88:1f:6e:53:98:18:cd:5b:49:a8:d3:d7:00 .^X..nS...[I.... 00000110 84:e6:ef:a7:1b:1d:65:12:21:23:b5:00:00:00:80:62 ......e.!#.....b 00000120 82:74:8d:7d:6d:03:87:f1:d7:da:4b:b8:38:fa:63:59 .t.}m.....K.8.cY 00000130 e3:83:54:91:4c:24:c9:33:fe:cf:b2:0d:c0:5a:52:49 ..T.L$.3.....ZRI 00000140 2f:e0:ba:d0:a8:3c:3f:7b:ee:e9:b2:22:76:33:d0:63 /.....?{..."v3.c 00000150 b6:df:59:be:da:ad:99:4c:76:ed:eb:16:c1:ae:44:94 ..Y....Lv.....D. 00000160 f9:fe:0e:d6:26:a9:06:83:46:81:29:55:fd:ce:2f:c4 ....&...F.)U../. 00000170 a6:b1:7b:0f:3f:89:27:d4:21:d3:be:a9:d4:3a:97:6a ..{.?.'.!....:.j 00000180 3c:1e:26:46:53:94:6c:e4:da:c1:04:55:b1:b5:a8:69 ..&FS.l....U...i 00000190 b6:f6:cb:3a:ae:42:e7:27:21:d6:c3:ca:45:87:40:00 ...:.B.'!...E.@. 000001a0 00:01:0f:00:00:00:07:73:73:68:2d:72:73:61:00:00 .......ssh-rsa.. 000001b0 01:00:30:21:6b:d6:8e:c1:33:ac:ce:10:4a:d6:5f:5c ..0!k...3...J._\ 000001c0 ee:c8:59:87:a9:02:ba:87:d0:41:f9:e5:ae:63:94:4c ..Y......A...c.L 000001d0 69:ab:35:f0:b8:dc:1f:e4:bb:fe:64:14:51:b4:51:e4 i.5.......d.Q.Q. 000001e0 b9:73:6d:63:12:e7:f9:23:95:88:2f:e9:ec:27:38:b6 .smc...#../..'8. 000001f0 74:d4:d9:e3:19:40:39:ae:38:86:a4:fe:05:f1:5f:79 t....@9.8....._y 00000200 c2:b7:b1:38:64:63:87:87:ac:de:29:d4:e7:d0:38:a1 ...8dc....)...8. 00000210 81:cb:ab:07:17:a8:53:9d:17:09:51:42:02:8f:91:d2 ......S...QB.... 00000220 92:2c:79:1e:4d:6a:1d:7d:05:89:6f:33:aa:fe:7e:7c .,y.Mj.}..o3..~| 00000230 6f:37:f4:78:3a:c9:da:06:a4:e2:0f:82:cc:03:a0:a8 o7.x:........... 00000240 b3:fb:fb:27:a3:4d:9d:8a:11:e1:41:50:68:1a:74:63 ...'.M....APh.tc 00000250 ce:88:76:a6:4b:58:40:bc:73:5a:39:bb:9a:e3:1b:ac ..v.KX@.sZ9..... 00000260 db:97:1d:a3:69:a1:ae:a3:4f:b5:4c:02:08:e3:6c:32 ....i...O.L...l2 00000270 f8:5d:48:db:13:43:5e:0d:06:95:a3:59:2d:9e:c8:e7 .]H..C^....Y-... 00000280 1f:20:11:8e:64:59:23:76:57:d8:fe:ef:ad:e1:8c:05 . ..dY#vW....... 00000290 a4:95:18:16:c7:44:93:8a:b0:5b:e9:15:0c:ab:c9:29 .....D...[.....) 000002a0 a8:8f:a5:46:e7:3a:91:cf:98:30:ab:bc:e4:85:95:87 ...F.:...0...... 000002b0 93:7a .z -> NET_SSH2_MSG_NEWKEYS (since last: 0.044, network: 0s) <- NET_SSH2_MSG_NEWKEYS (since last: 0.002, network: 0.002s) -> NET_SSH2_MSG_SERVICE_REQUEST (since last: 0.044, network: 0.001s) 00000000 00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74:68 ....ssh-userauth <- NET_SSH2_MSG_SERVICE_ACCEPT (since last: 0.003, network: 0.002s) 00000000 00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74:68 ....ssh-userauth

Thanks in advance!
bferk
Traveler
 
Posts: 3
Joined: Wed Aug 21, 2013 6:48 pm

Re: Trouble connecting to Cisco asr 9000

Postby TerraFrost » Wed Aug 21, 2013 7:43 pm

Can you do echo gettype($nKPass)?

Thanks!
TerraFrost
Legendary Guard
 
Posts: 12357
Joined: Wed Dec 04, 2002 6:37 am

Re: Trouble connecting to Cisco asr 9000

Postby bferk » Wed Aug 21, 2013 7:49 pm

I ran an
Code: Select all
echo gettype($nKPass);
and I got NULL back
bferk
Traveler
 
Posts: 3
Joined: Wed Aug 21, 2013 6:48 pm

Re: Trouble connecting to Cisco asr 9000

Postby TerraFrost » Wed Aug 21, 2013 8:25 pm

That's probably the problem. You're passing $nKPass to $nKCon->login and if it's NULL... I could see that causing problems.

Your login call:

Code: Select all
    if(!$nKCon->login($nKUser,$nKPass)){
TerraFrost
Legendary Guard
 
Posts: 12357
Joined: Wed Dec 04, 2002 6:37 am

Re: Trouble connecting to Cisco asr 9000

Postby bferk » Wed Aug 21, 2013 9:00 pm

*face palm* That was it, for whatever reason I forget to dump the password into that variable. Thanks for your help!
bferk
Traveler
 
Posts: 3
Joined: Wed Aug 21, 2013 6:48 pm


Return to phpseclib support

Who is online

Users browsing this forum: No registered users and 1 guest

cron