Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

we can not connect to server debian 11 #1891

Open
anaslaaji opened this issue Mar 3, 2023 · 4 comments
Open

we can not connect to server debian 11 #1891

anaslaaji opened this issue Mar 3, 2023 · 4 comments
Labels

Comments

@anaslaaji
Copy link

Hello my php apps using server debian 8 and when i try to use your lib for connect to server debian 11 via ssh i have login failed something block the connection do you have any idea or solutions thanks

@terrafrost
Copy link
Member

Can you post the SSH logs? You can get them by doing define('NET_SSH2_LOGGING', 2); at the top and then echo $ssh->getLog(); after your failed connection attempt.

If that's empty then it could be an issue with fsockopen (ie. a port isn't open or some such). Not a whole lot I'm gonna be able to do about that but, one step at a time lol. Gimme the SSH logs and we'll proceed from there.

Thanks!

@anaslaaji
Copy link
Author

anaslaaji commented Mar 6, 2023

Hello Sir , I have did the steps and the result is :

<-
00000000  53:53:48:2d:32:2e:30:2d:4f:70:65:6e:53:53:48:5f  SSH-2.0-OpenSSH_
00000010  38:2e:34:70:31:20:44:65:62:69:61:6e:2d:35:2b:64  8.4p1 Debian-5+d
00000020  65:62:31:31:75:31:0d:0a                          eb11u1..

->
00000000  53:53:48:2d:32:2e:30:2d:70:68:70:73:65:63:6c:69  SSH-2.0-phpsecli
00000010  62:5f:31:2e:30:20:28:6f:70:65:6e:73:73:6c:2c:20  b_1.0 (openssl, 
00000020  62:63:6d:61:74:68:29:0d:0a                       bcmath)..

<- NET_SSH2_MSG_KEXINIT (since last: 0.0169, network: 0s)
00000000  99:13:20:c4:d5:2f:24:bd:8f:70:30:f8:72:c4:40:14  .. ../$..p0.r.@.
00000010  00:00:00:ad: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:63:75:72:76:65:32:35  e-sha256,curve25
00000040  35:31:39:2d:73:68:61:32:35:36:2c:63:75:72:76:65  519-sha256,curve
00000050  32:35:35:31:39:2d:73:68:61:32:35:36:40:6c:69:62  25519-sha256@lib
00000060  73:73:68:2e:6f:72:67:2c:64:69:66:66:69:65:2d:68  ssh.org,diffie-h
00000070  65:6c:6c:6d:61:6e:2d:67:72:6f:75:70:31:36:2d:73  ellman-group16-s
00000080  68:61:35:31:32:2c:64:69:66:66:69:65:2d:68:65:6c  ha512,diffie-hel
00000090  6c:6d:61:6e:2d:67:72:6f:75:70:31:38:2d:73:68:61  lman-group18-sha
000000a0  35:31:32:2c:64:69:66:66:69:65:2d:68:65:6c:6c:6d  512,diffie-hellm
000000b0  61:6e:2d:67:72:6f:75:70:31:34:2d:73:68:61:32:35  an-group14-sha25
000000c0  36:00:00:00:25:72:73:61:2d:73:68:61:32:2d:35:31  6...%rsa-sha2-51
000000d0  32:2c:72:73:61:2d:73:68:61:32:2d:32:35:36:2c:73  2,rsa-sha2-256,s
000000e0  73:68:2d:65:64:32:35:35:31:39:00:00:00:6c:63:68  sh-ed25519...lch
000000f0  61:63:68:61:32:30:2d:70:6f:6c:79:31:33:30:35:40  acha20-poly1305@
00000100  6f:70:65:6e:73:73:68:2e:63:6f:6d:2c:61:65:73:32  openssh.com,aes2
00000110  35:36:2d:67:63:6d:40:6f:70:65:6e:73:73:68:2e:63  56-gcm@openssh.c
00000120  6f:6d:2c:61:65:73:31:32:38:2d:67:63:6d:40:6f:70  om,aes128-gcm@op
00000130  65:6e:73:73:68:2e:63:6f:6d:2c:61:65:73:32:35:36  enssh.com,aes256
00000140  2d:63:74:72:2c:61:65:73:31:39:32:2d:63:74:72:2c  -ctr,aes192-ctr,
00000150  61:65:73:31:32:38:2d:63:74:72:00:00:00:6c:63:68  aes128-ctr...lch
00000160  61:63:68:61:32:30:2d:70:6f:6c:79:31:33:30:35:40  acha20-poly1305@
00000170  6f:70:65:6e:73:73:68:2e:63:6f:6d:2c:61:65:73:32  openssh.com,aes2
00000180  35:36:2d:67:63:6d:40:6f:70:65:6e:73:73:68:2e:63  56-gcm@openssh.c
00000190  6f:6d:2c:61:65:73:31:32:38:2d:67:63:6d:40:6f:70  om,aes128-gcm@op
000001a0  65:6e:73:73:68:2e:63:6f:6d:2c:61:65:73:32:35:36  enssh.com,aes256
000001b0  2d:63:74:72:2c:61:65:73:31:39:32:2d:63:74:72:2c  -ctr,aes192-ctr,
000001c0  61:65:73:31:32:38:2d:63:74:72:00:00:00:57:68:6d  aes128-ctr...Whm
000001d0  61:63:2d:73:68:61:32:2d:35:31:32:2d:65:74:6d:40  ac-sha2-512-etm@
000001e0  6f:70:65:6e:73:73:68:2e:63:6f:6d:2c:68:6d:61:63  openssh.com,hmac
000001f0  2d:73:68:61:32:2d:32:35:36:2d:65:74:6d:40:6f:70  -sha2-256-etm@op
00000200  65:6e:73:73:68:2e:63:6f:6d:2c:68:6d:61:63:2d:73  enssh.com,hmac-s
00000210  68:61:32:2d:35:31:32:2c:68:6d:61:63:2d:73:68:61  ha2-512,hmac-sha
00000220  32:2d:32:35:36:00:00:00:57:68:6d:61:63:2d:73:68  2-256...Whmac-sh
00000230  61:32:2d:35:31:32:2d:65:74:6d:40:6f:70:65:6e:73  a2-512-etm@opens
00000240  73:68:2e:63:6f:6d:2c:68:6d:61:63:2d:73:68:61:32  sh.com,hmac-sha2
00000250  2d:32:35:36:2d:65:74:6d:40:6f:70:65:6e:73:73:68  -256-etm@openssh
00000260  2e:63:6f:6d:2c:68:6d:61:63:2d:73:68:61:32:2d:35  .com,hmac-sha2-5
00000270  31:32:2c:68:6d:61:63:2d:73:68:61:32:2d:32:35:36  12,hmac-sha2-256
00000280  00:00:00:15:6e:6f:6e:65:2c:7a:6c:69:62:40:6f:70  ....none,zlib@op
00000290  65:6e:73:73:68:2e:63:6f:6d:00:00:00:15:6e:6f:6e  enssh.com....non
000002a0  65:2c:7a:6c:69:62:40:6f:70:65:6e:73:73:68:2e:63  e,zlib@openssh.c
000002b0  6f:6d:00:00:00:00:00:00:00:00:00:00:00:00:00     om.............

-> NET_SSH2_MSG_KEXINIT (since last: 0.0003, network: 0s)
00000000  8b:dd:e3:25:0b:75:91:c6:d1:64:06:e6:bf:a4:12:e0  ...%.u...d......
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:72:73:61:2c:73:73  56....ssh-rsa,ss
000000a0  68:2d:64:73:73:00:00:00:e9:61:72:63:66:6f:75:72  h-dss....arcfour
000000b0  32:35:36:2c:61:72:63:66:6f:75:72:31:32:38:2c:61  256,arcfour128,a
000000c0  65:73:31:32:38:2d:63:74:72:2c:61:65:73:31:39:32  es128-ctr,aes192
000000d0  2d:63:74:72:2c:61:65:73:32:35:36:2d:63:74:72:2c  -ctr,aes256-ctr,
000000e0  74:77:6f:66:69:73:68:31:32:38:2d:63:74:72:2c:74  twofish128-ctr,t
000000f0  77:6f:66:69:73:68:31:39:32:2d:63:74:72:2c:74:77  wofish192-ctr,tw
00000100  6f:66:69:73:68:32:35:36:2d:63:74:72:2c:61:65:73  ofish256-ctr,aes
00000110  31:32:38:2d:63:62:63:2c:61:65:73:31:39:32:2d:63  128-cbc,aes192-c
00000120  62:63:2c:61:65:73:32:35:36:2d:63:62:63:2c:74:77  bc,aes256-cbc,tw
00000130  6f:66:69:73:68:31:32:38:2d:63:62:63:2c:74:77:6f  ofish128-cbc,two
00000140  66:69:73:68:31:39:32:2d:63:62:63:2c:74:77:6f:66  fish192-cbc,twof
00000150  69:73:68:32:35:36:2d:63:62:63:2c:74:77:6f:66:69  ish256-cbc,twofi
00000160  73:68:2d:63:62:63:2c:62:6c:6f:77:66:69:73:68:2d  sh-cbc,blowfish-
00000170  63:74:72:2c:62:6c:6f:77:66:69:73:68:2d:63:62:63  ctr,blowfish-cbc
00000180  2c:33:64:65:73:2d:63:74:72:2c:33:64:65:73:2d:63  ,3des-ctr,3des-c
00000190  62:63:00:00:00:e9:61:72:63:66:6f:75:72:32:35:36  bc....arcfour256
000001a0  2c:61:72:63:66:6f:75:72:31:32:38:2c:61:65:73:31  ,arcfour128,aes1
000001b0  32:38:2d:63:74:72:2c:61:65:73:31:39:32:2d:63:74  28-ctr,aes192-ct
000001c0  72:2c:61:65:73:32:35:36:2d:63:74:72:2c:74:77:6f  r,aes256-ctr,two
000001d0  66:69:73:68:31:32:38:2d:63:74:72:2c:74:77:6f:66  fish128-ctr,twof
000001e0  69:73:68:31:39:32:2d:63:74:72:2c:74:77:6f:66:69  ish192-ctr,twofi
000001f0  73:68:32:35:36:2d:63:74:72:2c:61:65:73:31:32:38  sh256-ctr,aes128
00000200  2d:63:62:63:2c:61:65:73:31:39:32:2d:63:62:63:2c  -cbc,aes192-cbc,
00000210  61:65:73:32:35:36:2d:63:62:63:2c:74:77:6f:66:69  aes256-cbc,twofi
00000220  73:68:31:32:38:2d:63:62:63:2c:74:77:6f:66:69:73  sh128-cbc,twofis
00000230  68:31:39:32:2d:63:62:63:2c:74:77:6f:66:69:73:68  h192-cbc,twofish
00000240  32:35:36:2d:63:62:63:2c:74:77:6f:66:69:73:68:2d  256-cbc,twofish-
00000250  63:62:63:2c:62:6c:6f:77:66:69:73:68:2d:63:74:72  cbc,blowfish-ctr
00000260  2c:62:6c:6f:77:66:69:73:68:2d:63:62:63:2c:33:64  ,blowfish-cbc,3d
00000270  65:73:2d:63:74:72:2c:33:64:65:73:2d:63:62:63:00  es-ctr,3des-cbc.
00000280  00:00:39:68:6d:61:63:2d:73:68:61:32:2d:32:35:36  ..9hmac-sha2-256
00000290  2c:68:6d:61:63:2d:73:68:61:31:2d:39:36:2c:68:6d  ,hmac-sha1-96,hm
000002a0  61:63:2d:73:68:61:31:2c:68:6d:61:63:2d:6d:64:35  ac-sha1,hmac-md5
000002b0  2d:39:36:2c:68:6d:61:63:2d:6d:64:35:00:00:00:39  -96,hmac-md5...9
000002c0  68:6d:61:63:2d:73:68:61:32:2d:32:35:36:2c:68:6d  hmac-sha2-256,hm
000002d0  61:63:2d:73:68:61:31:2d:39:36:2c:68:6d:61:63:2d  ac-sha1-96,hmac-
000002e0  73:68:61:31:2c:68:6d:61:63:2d:6d:64:35:2d:39:36  sha1,hmac-md5-96
000002f0  2c:68:6d:61:63:2d:6d:64:35:00:00:00:04:6e:6f:6e  ,hmac-md5....non
00000300  65:00:00:00:04:6e:6f:6e:65:00:00:00:00:00:00:00  e....none.......
00000310  00:00:00:00:00:00                                ......

-> UNKNOWN (34) (since last: 0.0001, network: 0s)
00000000  00:00:06:00:00:00:08:00:00:00:10:00              ............

@anaslaaji
Copy link
Author

Hello Sir @terrafrost could you help me please

@terrafrost
Copy link
Member

It looks like they've both agreed to use diffie-hellman-group-exchange-sha256, which means that the UNKNOWN packet is actually NET_SSH2_MSG_KEXDH_GEX_INIT.

Sadly, that doesn't tell me much. Can you instead get me the server logs? Like enable verbose logging in SSH and connect that way. The way I normally do it I do sudo /usr/sbin/sshd -ddd -p2222

@bantu bantu added the support label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants