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

Server Terminates Connection #1977

Open
Buddierdl opened this issue Jan 18, 2024 · 8 comments
Open

Server Terminates Connection #1977

Buddierdl opened this issue Jan 18, 2024 · 8 comments

Comments

@Buddierdl
Copy link

Buddierdl commented Jan 18, 2024

Hi,

I'm having trouble logging into an SFTP server. It worked fine before, then the SFTP server domain changed and now I'm now longer able to connect. I'm assuming they also upgraded the SFTP server somehow with the domain change and that is causing the issue, but I'm not able to see the receiving end. I can connect manually to the SFTP through a shell. It is just username/password authentication. Here is the log file:

<-
00000000  53:53:48:2d:32:2e:30:2d:41:57:53:5f:53:46:54:50  SSH-2.0-AWS_SFTP
00000010  5f:31:2e:31:0d:0a                                _1.1..

->
00000000  53:53:48:2d:32:2e:30:2d:70:68:70:73:65:63:6c:69  SSH-2.0-phpsecli
00000010  62:5f:33:2e:30:20:28:6c:69:62:73:6f:64:69:75:6d  b_3.0 (libsodium
00000020  2c:20:6f:70:65:6e:73:73:6c:2c:20:67:6d:70:29:0d  , openssl, gmp).
00000030  0a                                               .

-> NET_SSH2_MSG_KEXINIT (since last: 0.1913, network: 0s)
00000000  11:77:14:a3:2f:cf:13:23:00:fb:86:15:70:d2:e7:05  .w../..#....p...
00000010  00:00:01:a4:63:75:72:76:65:32:35:35:31:39:2d:73  ....curve25519-s
00000020  68:61:32:35:36:2c:63:75:72:76:65:32:35:35:31:39  ha256,curve25519
00000030  2d:73:68:61:32:35:36:40:6c:69:62:73:73:68:2e:6f  -sha256@libssh.o
00000040  72:67:2c:65:63:64:68:2d:73:68:61:32:2d:6e:69:73  rg,ecdh-sha2-nis
00000050  74:70:32:35:36:2c:65:63:64:68:2d:73:68:61:32:2d  tp256,ecdh-sha2-
00000060  6e:69:73:74:70:33:38:34:2c:65:63:64:68:2d:73:68  nistp384,ecdh-sh
00000070  61:32:2d:6e:69:73:74:70:35:32:31:2c:64:69:66:66  a2-nistp521,diff
00000080  69:65:2d:68:65:6c:6c:6d:61:6e:2d:67:72:6f:75:70  ie-hellman-group
00000090  2d:65:78:63:68:61:6e:67:65:2d:73:68:61:32:35:36  -exchange-sha256
000000a0  2c:64:69:66:66:69:65:2d:68:65:6c:6c:6d:61:6e:2d  ,diffie-hellman-
000000b0  67:72:6f:75:70:2d:65:78:63:68:61:6e:67:65:2d:73  group-exchange-s
000000c0  68:61:31:2c:64:69:66:66:69:65:2d:68:65:6c:6c:6d  ha1,diffie-hellm
000000d0  61:6e:2d:67:72:6f:75:70:31:34:2d:73:68:61:32:35  an-group14-sha25
000000e0  36:2c:64:69:66:66:69:65:2d:68:65:6c:6c:6d:61:6e  6,diffie-hellman
000000f0  2d:67:72:6f:75:70:31:34:2d:73:68:61:31:2c:64:69  -group14-sha1,di
00000100  66:66:69:65:2d:68:65:6c:6c:6d:61:6e:2d:67:72:6f  ffie-hellman-gro
00000110  75:70:31:35:2d:73:68:61:35:31:32:2c:64:69:66:66  up15-sha512,diff
00000120  69:65:2d:68:65:6c:6c:6d:61:6e:2d:67:72:6f:75:70  ie-hellman-group
00000130  31:36:2d:73:68:61:35:31:32:2c:64:69:66:66:69:65  16-sha512,diffie
00000140  2d:68:65:6c:6c:6d:61:6e:2d:67:72:6f:75:70:31:37  -hellman-group17
00000150  2d:73:68:61:35:31:32:2c:64:69:66:66:69:65:2d:68  -sha512,diffie-h
00000160  65:6c:6c:6d:61:6e:2d:67:72:6f:75:70:31:38:2d:73  ellman-group18-s
00000170  68:61:35:31:32:2c:64:69:66:66:69:65:2d:68:65:6c  ha512,diffie-hel
00000180  6c:6d:61:6e:2d:67:72:6f:75:70:31:2d:73:68:61:31  lman-group1-sha1
00000190  2c:65:78:74:2d:69:6e:66:6f:2d:63:2c:6b:65:78:2d  ,ext-info-c,kex-
000001a0  73:74:72:69:63:74:2d:63:2d:76:30:30:40:6f:70:65  strict-c-v00@ope
000001b0  6e:73:73:68:2e:63:6f:6d:00:00:00:71:73:73:68:2d  nssh.com...qssh-
000001c0  65:64:32:35:35:31:39:2c:65:63:64:73:61:2d:73:68  ed25519,ecdsa-sh
000001d0  61:32:2d:6e:69:73:74:70:32:35:36:2c:65:63:64:73  a2-nistp256,ecds
000001e0  61:2d:73:68:61:32:2d:6e:69:73:74:70:33:38:34:2c  a-sha2-nistp384,
000001f0  65:63:64:73:61:2d:73:68:61:32:2d:6e:69:73:74:70  ecdsa-sha2-nistp
00000200  35:32:31:2c:72:73:61:2d:73:68:61:32:2d:32:35:36  521,rsa-sha2-256
00000210  2c:72:73:61:2d:73:68:61:32:2d:35:31:32:2c:73:73  ,rsa-sha2-512,ss
00000220  68:2d:72:73:61:2c:73:73:68:2d:64:73:73:00:00:01  h-rsa,ssh-dss...
00000230  01:61:65:73:32:35:36:2d:67:63:6d:40:6f:70:65:6e  .aes256-gcm@open
00000240  73:73:68:2e:63:6f:6d:2c:61:65:73:31:32:38:2d:67  ssh.com,aes128-g
00000250  63:6d:40:6f:70:65:6e:73:73:68:2e:63:6f:6d:2c:61  cm@openssh.com,a
00000260  65:73:31:32:38:2d:63:74:72:2c:61:65:73:31:39:32  es128-ctr,aes192
00000270  2d:63:74:72:2c:61:65:73:32:35:36:2d:63:74:72:2c  -ctr,aes256-ctr,
00000280  61:65:73:31:32:38:2d:63:62:63:2c:61:65:73:31:39  aes128-cbc,aes19
00000290  32:2d:63:62:63:2c:61:65:73:32:35:36:2d:63:62:63  2-cbc,aes256-cbc
000002a0  2c:33:64:65:73:2d:63:74:72:2c:33:64:65:73:2d:63  ,3des-ctr,3des-c
000002b0  62:63:2c:74:77:6f:66:69:73:68:31:32:38:2d:63:74  bc,twofish128-ct
000002c0  72:2c:74:77:6f:66:69:73:68:31:39:32:2d:63:74:72  r,twofish192-ctr
000002d0  2c:74:77:6f:66:69:73:68:32:35:36:2d:63:74:72:2c  ,twofish256-ctr,
000002e0  74:77:6f:66:69:73:68:31:32:38:2d:63:62:63:2c:74  twofish128-cbc,t
000002f0  77:6f:66:69:73:68:31:39:32:2d:63:62:63:2c:74:77  wofish192-cbc,tw
00000300  6f:66:69:73:68:32:35:36:2d:63:62:63:2c:74:77:6f  ofish256-cbc,two
00000310  66:69:73:68:2d:63:62:63:2c:62:6c:6f:77:66:69:73  fish-cbc,blowfis
00000320  68:2d:63:74:72:2c:62:6c:6f:77:66:69:73:68:2d:63  h-ctr,blowfish-c
00000330  62:63:00:00:01:01:61:65:73:32:35:36:2d:67:63:6d  bc....aes256-gcm
00000340  40:6f:70:65:6e:73:73:68:2e:63:6f:6d:2c:61:65:73  @openssh.com,aes
00000350  31:32:38:2d:67:63:6d:40:6f:70:65:6e:73:73:68:2e  128-gcm@openssh.
00000360  63:6f:6d:2c:61:65:73:31:32:38:2d:63:74:72:2c:61  com,aes128-ctr,a
00000370  65:73:31:39:32:2d:63:74:72:2c:61:65:73:32:35:36  es192-ctr,aes256
00000380  2d:63:74:72:2c:61:65:73:31:32:38:2d:63:62:63:2c  -ctr,aes128-cbc,
00000390  61:65:73:31:39:32:2d:63:62:63:2c:61:65:73:32:35  aes192-cbc,aes25
000003a0  36:2d:63:62:63:2c:33:64:65:73:2d:63:74:72:2c:33  6-cbc,3des-ctr,3
000003b0  64:65:73:2d:63:62:63:2c:74:77:6f:66:69:73:68:31  des-cbc,twofish1
000003c0  32:38:2d:63:74:72:2c:74:77:6f:66:69:73:68:31:39  28-ctr,twofish19
000003d0  32:2d:63:74:72:2c:74:77:6f:66:69:73:68:32:35:36  2-ctr,twofish256
000003e0  2d:63:74:72:2c:74:77:6f:66:69:73:68:31:32:38:2d  -ctr,twofish128-
000003f0  63:62:63:2c:74:77:6f:66:69:73:68:31:39:32:2d:63  cbc,twofish192-c
00000400  62:63:2c:74:77:6f:66:69:73:68:32:35:36:2d:63:62  bc,twofish256-cb
00000410  63:2c:74:77:6f:66:69:73:68:2d:63:62:63:2c:62:6c  c,twofish-cbc,bl
00000420  6f:77:66:69:73:68:2d:63:74:72:2c:62:6c:6f:77:66  owfish-ctr,blowf
00000430  69:73:68:2d:63:62:63:00:00:00:f7:68:6d:61:63:2d  ish-cbc....hmac-
00000440  73:68:61:32:2d:32:35:36:2d:65:74:6d:40:6f:70:65  sha2-256-etm@ope
00000450  6e:73:73:68:2e:63:6f:6d:2c:68:6d:61:63:2d:73:68  nssh.com,hmac-sh
00000460  61:32:2d:35:31:32:2d:65:74:6d:40:6f:70:65:6e:73  a2-512-etm@opens
00000470  73:68:2e:63:6f:6d:2c:75:6d:61:63:2d:36:34:2d:65  sh.com,umac-64-e
00000480  74:6d:40:6f:70:65:6e:73:73:68:2e:63:6f:6d:2c:75  tm@openssh.com,u
00000490  6d:61:63:2d:31:32:38:2d:65:74:6d:40:6f:70:65:6e  mac-128-etm@open
000004a0  73:73:68:2e:63:6f:6d:2c:68:6d:61:63:2d:73:68:61  ssh.com,hmac-sha
000004b0  31:2d:65:74:6d:40:6f:70:65:6e:73:73:68:2e:63:6f  1-etm@openssh.co
000004c0  6d:2c:68:6d:61:63:2d:73:68:61:32:2d:32:35:36:2c  m,hmac-sha2-256,
000004d0  68:6d:61:63:2d:73:68:61:32:2d:35:31:32:2c:75:6d  hmac-sha2-512,um
000004e0  61:63:2d:36:34:40:6f:70:65:6e:73:73:68:2e:63:6f  ac-64@openssh.co
000004f0  6d:2c:75:6d:61:63:2d:31:32:38:40:6f:70:65:6e:73  m,umac-128@opens
00000500  73:68:2e:63:6f:6d:2c:68:6d:61:63:2d:73:68:61:31  sh.com,hmac-sha1
00000510  2d:39:36:2c:68:6d:61:63:2d:73:68:61:31:2c:68:6d  -96,hmac-sha1,hm
00000520  61:63:2d:6d:64:35:2d:39:36:2c:68:6d:61:63:2d:6d  ac-md5-96,hmac-m
00000530  64:35:00:00:00:f7:68:6d:61:63:2d:73:68:61:32:2d  d5....hmac-sha2-
00000540  32:35:36:2d:65:74:6d:40:6f:70:65:6e:73:73:68:2e  256-etm@openssh.
00000550  63:6f:6d:2c:68:6d:61:63:2d:73:68:61:32:2d:35:31  com,hmac-sha2-51
00000560  32:2d:65:74:6d:40:6f:70:65:6e:73:73:68:2e:63:6f  2-etm@openssh.co
00000570  6d:2c:75:6d:61:63:2d:36:34:2d:65:74:6d:40:6f:70  m,umac-64-etm@op
00000580  65:6e:73:73:68:2e:63:6f:6d:2c:75:6d:61:63:2d:31  enssh.com,umac-1
00000590  32:38:2d:65:74:6d:40:6f:70:65:6e:73:73:68:2e:63  28-etm@openssh.c
000005a0  6f:6d:2c:68:6d:61:63:2d:73:68:61:31:2d:65:74:6d  om,hmac-sha1-etm
000005b0  40:6f:70:65:6e:73:73:68:2e:63:6f:6d:2c:68:6d:61  @openssh.com,hma
000005c0  63:2d:73:68:61:32:2d:32:35:36:2c:68:6d:61:63:2d  c-sha2-256,hmac-
000005d0  73:68:61:32:2d:35:31:32:2c:75:6d:61:63:2d:36:34  sha2-512,umac-64
000005e0  40:6f:70:65:6e:73:73:68:2e:63:6f:6d:2c:75:6d:61  @openssh.com,uma
000005f0  63:2d:31:32:38:40:6f:70:65:6e:73:73:68:2e:63:6f  c-128@openssh.co
00000600  6d:2c:68:6d:61:63:2d:73:68:61:31:2d:39:36:2c:68  m,hmac-sha1-96,h
00000610  6d:61:63:2d:73:68:61:31:2c:68:6d:61:63:2d:6d:64  mac-sha1,hmac-md
00000620  35:2d:39:36:2c:68:6d:61:63:2d:6d:64:35:00:00:00  5-96,hmac-md5...
00000630  1a:6e:6f:6e:65:2c:7a:6c:69:62:40:6f:70:65:6e:73  .none,zlib@opens
00000640  73:68:2e:63:6f:6d:2c:7a:6c:69:62:00:00:00:1a:6e  sh.com,zlib....n
00000650  6f:6e:65:2c:7a:6c:69:62:40:6f:70:65:6e:73:73:68  one,zlib@openssh
00000660  2e:63:6f:6d:2c:7a:6c:69:62:00:00:00:00:00:00:00  .com,zlib.......
00000670  00:00:00:00:00:00                                ......

<- NET_SSH2_MSG_KEXINIT (since last: 0.0615, network: 0.0614s)
00000000  ed:1a:da:59:ee:6a:40:81:80:4d:a0:c3:92:13:73:72  ...Y.j@..M....sr
00000010  00:00:00:b7:65:63:64:68:2d:73:68:61:32:2d:6e:69  ....ecdh-sha2-ni
00000020  73:74:70:32:35:36:2c:65:63:64:68:2d:73:68:61:32  stp256,ecdh-sha2
00000030  2d:6e:69:73:74:70:33:38:34:2c:65:63:64:68:2d:73  -nistp384,ecdh-s
00000040  68:61:32:2d:6e:69:73:74:70:35:32:31:2c:64:69:66  ha2-nistp521,dif
00000050  66:69:65:2d:68:65:6c:6c:6d:61:6e:2d:67:72:6f:75  fie-hellman-grou
00000060  70:2d:65:78:63:68:61:6e:67:65:2d:73:68:61:32:35  p-exchange-sha25
00000070  36:2c:64:69:66:66:69:65:2d:68:65:6c:6c:6d:61:6e  6,diffie-hellman
00000080  2d:67:72:6f:75:70:31:36:2d:73:68:61:35:31:32:2c  -group16-sha512,
00000090  64:69:66:66:69:65:2d:68:65:6c:6c:6d:61:6e:2d:67  diffie-hellman-g
000000a0  72:6f:75:70:31:38:2d:73:68:61:35:31:32:2c:64:69  roup18-sha512,di
000000b0  66:66:69:65:2d:68:65:6c:6c:6d:61:6e:2d:67:72:6f  ffie-hellman-gro
000000c0  75:70:31:34:2d:73:68:61:32:35:36:00:00:00:21:72  up14-sha256...!r
000000d0  73:61:2d:73:68:61:32:2d:35:31:32:2c:72:73:61:2d  sa-sha2-512,rsa-
000000e0  73:68:61:32:2d:32:35:36:2c:73:73:68:2d:72:73:61  sha2-256,ssh-rsa
000000f0  00:00:00:6c:63:68:61:63:68:61:32:30:2d:70:6f:6c  ...lchacha20-pol
00000100  79:31:33:30:35:40:6f:70:65:6e:73:73:68:2e:63:6f  y1305@openssh.co
00000110  6d:2c:61:65:73:31:32:38:2d:63:74:72:2c:61:65:73  m,aes128-ctr,aes
00000120  31:39:32:2d:63:74:72:2c:61:65:73:32:35:36:2d:63  192-ctr,aes256-c
00000130  74:72:2c:61:65:73:31:32:38:2d:67:63:6d:40:6f:70  tr,aes128-gcm@op
00000140  65:6e:73:73:68:2e:63:6f:6d:2c:61:65:73:32:35:36  enssh.com,aes256
00000150  2d:67:63:6d:40:6f:70:65:6e:73:73:68:2e:63:6f:6d  -gcm@openssh.com
00000160  00:00:00:6c:63:68:61:63:68:61:32:30:2d:70:6f:6c  ...lchacha20-pol
00000170  79:31:33:30:35:40:6f:70:65:6e:73:73:68:2e:63:6f  y1305@openssh.co
00000180  6d:2c:61:65:73:31:32:38:2d:63:74:72:2c:61:65:73  m,aes128-ctr,aes
00000190  31:39:32:2d:63:74:72:2c:61:65:73:32:35:36:2d:63  192-ctr,aes256-c
000001a0  74:72:2c:61:65:73:31:32:38:2d:67:63:6d:40:6f:70  tr,aes128-gcm@op
000001b0  65:6e:73:73:68:2e:63:6f:6d:2c:61:65:73:32:35:36  enssh.com,aes256
000001c0  2d:67:63:6d:40:6f:70:65:6e:73:73:68:2e:63:6f:6d  -gcm@openssh.com
000001d0  00:00:00:85:75:6d:61:63:2d:31:32:38:2d:65:74:6d  ....umac-128-etm
000001e0  40:6f:70:65:6e:73:73:68:2e:63:6f:6d:2c:68:6d:61  @openssh.com,hma
000001f0  63:2d:73:68:61:32:2d:32:35:36:2d:65:74:6d:40:6f  c-sha2-256-etm@o
00000200  70:65:6e:73:73:68:2e:63:6f:6d:2c:68:6d:61:63:2d  penssh.com,hmac-
00000210  73:68:61:32:2d:35:31:32:2d:65:74:6d:40:6f:70:65  sha2-512-etm@ope
00000220  6e:73:73:68:2e:63:6f:6d:2c:75:6d:61:63:2d:31:32  nssh.com,umac-12
00000230  38:40:6f:70:65:6e:73:73:68:2e:63:6f:6d:2c:68:6d  8@openssh.com,hm
00000240  61:63:2d:73:68:61:32:2d:32:35:36:2c:68:6d:61:63  ac-sha2-256,hmac
00000250  2d:73:68:61:32:2d:35:31:32:00:00:00:85:75:6d:61  -sha2-512....uma
00000260  63:2d:31:32:38:2d:65:74:6d:40:6f:70:65:6e:73:73  c-128-etm@openss
00000270  68:2e:63:6f:6d:2c:68:6d:61:63:2d:73:68:61:32:2d  h.com,hmac-sha2-
00000280  32:35:36:2d:65:74:6d:40:6f:70:65:6e:73:73:68:2e  256-etm@openssh.
00000290  63:6f:6d:2c:68:6d:61:63:2d:73:68:61:32:2d:35:31  com,hmac-sha2-51
000002a0  32:2d:65:74:6d:40:6f:70:65:6e:73:73:68:2e:63:6f  2-etm@openssh.co
000002b0  6d:2c:75:6d:61:63:2d:31:32:38:40:6f:70:65:6e:73  m,umac-128@opens
000002c0  73:68:2e:63:6f:6d:2c:68:6d:61:63:2d:73:68:61:32  sh.com,hmac-sha2
000002d0  2d:32:35:36:2c:68:6d:61:63:2d:73:68:61:32:2d:35  -256,hmac-sha2-5
000002e0  31:32:00:00:00:15:6e:6f:6e:65:2c:7a:6c:69:62:40  12....none,zlib@
000002f0  6f:70:65:6e:73:73:68:2e:63:6f:6d:00:00:00:15:6e  openssh.com....n
00000300  6f:6e:65:2c:7a:6c:69:62:40:6f:70:65:6e:73:73:68  one,zlib@openssh
00000310  2e:63:6f:6d:00:00:00:00:00:00:00:00:00:00:00:00  .com............
00000320  00                                               .

-> NET_SSH2_MSG_KEX_ECDH_INIT (since last: 0.0883, network: 0.0001s)
00000000  00:00:00:41:04:08:f7:2b:83:e5:84:98:89:3b:97:f3  ...A...+.....;..
00000010  22:3e:5c:21:4c:e9:62:29:11:12:bd:60:49:d7:79:97  ">\!L.b)...`I.y.
00000020  af:de:31:48:4e:9a:9c:84:87:4a:0c:28:3d:5a:b8:34  ..1HN....J.(=Z.4
00000030  12:ce:94:a2:c9:98:d5:3b:d5:28:d5:15:07:45:dd:3a  .......;.(...E.:
00000040  46:da:aa:3a:b6                                   F..:.

<- NET_SSH2_MSG_KEX_ECDH_REPLY (since last: 0.0654, network: 0.0653s)
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:a7:2f:31:65:c4  ............/1e.
00000020  00:ce:8e:96:09:38:4a:f9:f1:67:c1:42:3a:55:30:28  .....8J..g.B:U0(
00000030  db:ef:ad:d8:5a:dc:c9:ed:96:d2:41:87:e3:e6:27:14  ....Z.....A...'.
00000040  d6:0f:e5:52:10:fe:e5:7a:aa:a6:22:1b:06:32:28:b0  ...R...z.."..2(.
00000050  2b:55:f4:4a:c3:a9:b1:11:02:02:75:00:cf:27:44:33  +U.J......u..'D3
00000060  9e:8e:7a:97:bb:72:c0:1d:2d:c8:46:d8:61:5e:45:e8  ..z..r..-.F.a^E.
00000070  6d:3a:56:09:c5:dd:36:c2:2f:86:f9:6d:13:8e:dd:51  m:V...6./..m...Q
00000080  a9:c6:d2:28:29:e7:5d:3f:8a:50:be:aa:b5:8c:c7:3c  ...().]?.P......
00000090  40:a6:9d:65:90:7e:7e:0c:32:9f:8f:b4:32:cb:a5:71  @..e.~~.2...2..q
000000a0  27:08:23:bb:fc:c7:f4:21:87:55:96:94:84:ea:4b:54  '.#....!.U....KT
000000b0  23:f4:ef:a0:c9:f8:09:fa:44:61:81:0e:65:4f:fc:7b  #.......Da..eO.{
000000c0  e8:09:c6:b3:84:ce:0c:e0:16:3c:53:21:6e:fc:22:f5  ..........S!n.".
000000d0  41:f4:93:e7:c7:df:b4:76:a7:4b:4d:51:9e:81:46:a0  A......v.KMQ..F.
000000e0  80:3b:d5:4e:32:da:3e:c7:29:be:86:2e:e7:4a:8f:d7  .;.N2.>.)....J..
000000f0  de:07:79:3f:14:bf:76:6f:ae:22:7a:77:14:a8:77:f8  ..y?..vo."zw..w.
00000100  cc:77:1c:2e:e0:29:f4:3e:1e:29:0c:6e:3f:27:fc:5e  .w...).>.).n?'.^
00000110  c6:d1:03:68:20:7c:a4:ce:08:07:0b:00:00:00:41:04  ...h |........A.
00000120  09:a7:be:61:5a:f8:fa:46:94:1a:77:a3:fa:6d:32:bf  ...aZ..F..w..m2.
00000130  89:1f:59:51:85:6f:ce:ee:f7:30:ff:73:e3:54:bd:bc  ..YQ.o...0.s.T..
00000140  14:05:1c:00:cb:67:1d:97:ce:8b:b0:f7:54:f6:e2:93  .....g......T...
00000150  6e:d9:81:2f:86:37:31:ff:0f:55:c8:da:09:14:23:ed  n../.71..U....#.
00000160  00:00:01:14:00:00:00:0c:72:73:61:2d:73:68:61:32  ........rsa-sha2
00000170  2d:32:35:36:00:00:01:00:89:91:a0:b1:4d:0a:9f:d8  -256........M...
00000180  cd:34:d4:96:a8:63:eb:83:6a:8b:c2:c9:9c:be:ab:a1  .4...c..j.......
00000190  da:5d:7b:77:83:16:27:df:7c:41:fb:eb:c5:37:bc:72  .]{w..'.|A...7.r
000001a0  9e:30:5c:db:1e:d5:50:50:d3:83:49:e9:f7:06:6d:df  .0\...PP..I...m.
000001b0  67:83:95:ef:54:37:0f:b2:fd:66:d0:29:b2:f0:76:2a  g...T7...f.)..v*
000001c0  7c:4b:13:05:13:69:d6:ea:04:6b:4e:a8:8f:ba:53:38  |K...i...kN...S8
000001d0  1d:15:4f:d8:51:9b:c5:ba:88:2c:b3:94:dc:c2:0d:ba  ..O.Q....,......
000001e0  fc:c1:16:f5:c8:19:c7:e9:d3:5e:04:67:c7:d4:f1:88  .........^.g....
000001f0  ab:d0:47:b6:84:a9:f4:48:f0:b4:09:8a:6d:12:2a:95  ..G....H....m.*.
00000200  0d:1b:43:01:69:35:21:04:1a:dc:0c:fd:19:8b:6b:6b  ..C.i5!.......kk
00000210  a7:96:c4:a1:15:5e:a0:9b:a4:f0:ec:dc:d0:7d:f7:06  .....^.......}..
00000220  52:fd:7b:67:95:ca:e6:af:63:6b:bd:61:fc:56:7a:2e  R.{g....ck.a.Vz.
00000230  2e:48:68:ed:cb:27:56:28:29:3f:68:4d:4c:79:37:83  .Hh..'V()?hMLy7.
00000240  8b:9b:c9:81:b6:eb:d3:03:c6:c3:e1:1e:13:b9:07:2d  ...............-
00000250  97:1d:14:24:79:b7:5a:52:7d:39:5e:a8:cb:1f:8a:0b  ...$y.ZR}9^.....
00000260  13:75:f2:98:3c:5b:c3:88:27:2f:7b:24:38:29:c8:bf  .u...[..'/{$8)..
00000270  93:3c:75:c0:21:ba:5b:df                          ..u.!.[.

-> NET_SSH2_MSG_NEWKEYS (since last: 0.0764, network: 0.0001s)
                                                 

<- NET_SSH2_MSG_NEWKEYS (since last: 0.0001, network: 0s)
                                                 

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

<- NET_SSH2_MSG_EXT_INFO (since last: 0, network: 0s)
00000000  00:00:00:01:00:00:00:0f:73:65:72:76:65:72:2d:73  ........server-s
00000010  69:67:2d:61:6c:67:73:00:00:00:db:73:73:68:2d:65  ig-algs....ssh-e
00000020  64:32:35:35:31:39:2c:73:6b:2d:73:73:68:2d:65:64  d25519,sk-ssh-ed
00000030  32:35:35:31:39:40:6f:70:65:6e:73:73:68:2e:63:6f  25519@openssh.co
00000040  6d:2c:73:73:68:2d:72:73:61:2c:72:73:61:2d:73:68  m,ssh-rsa,rsa-sh
00000050  61:32:2d:32:35:36:2c:72:73:61:2d:73:68:61:32:2d  a2-256,rsa-sha2-
00000060  35:31:32:2c:73:73:68:2d:64:73:73:2c:65:63:64:73  512,ssh-dss,ecds
00000070  61:2d:73:68:61:32:2d:6e:69:73:74:70:32:35:36:2c  a-sha2-nistp256,
00000080  65:63:64:73:61:2d:73:68:61:32:2d:6e:69:73:74:70  ecdsa-sha2-nistp
00000090  33:38:34:2c:65:63:64:73:61:2d:73:68:61:32:2d:6e  384,ecdsa-sha2-n
000000a0  69:73:74:70:35:32:31:2c:73:6b:2d:65:63:64:73:61  istp521,sk-ecdsa
000000b0  2d:73:68:61:32:2d:6e:69:73:74:70:32:35:36:40:6f  -sha2-nistp256@o
000000c0  70:65:6e:73:73:68:2e:63:6f:6d:2c:77:65:62:61:75  penssh.com,webau
000000d0  74:68:6e:2d:73:6b:2d:65:63:64:73:61:2d:73:68:61  thn-sk-ecdsa-sha
000000e0  32:2d:6e:69:73:74:70:32:35:36:40:6f:70:65:6e:73  2-nistp256@opens
000000f0  73:68:2e:63:6f:6d                                sh.com

<- NET_SSH2_MSG_SERVICE_ACCEPT (since last: 0.1683, network: 0.1683s)
00000000  00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74:68  ....ssh-userauth

-> NET_SSH2_MSG_USERAUTH_REQUEST (since last: 0.0002, network: 0s)
00000000  00:00:00:09:66:61:5f:31:37:32:32:30:37:00:00:00  ....fa_172207...
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

<- NET_SSH2_MSG_USERAUTH_FAILURE (since last: 0.0707, network: 0.0706s)
00000000  00:00:00:12:70:75:62:6c:69:63:6b:65:79:2c:70:61  ....publickey,pa
00000010  73:73:77:6f:72:64:00                             ssword.

-> NET_SSH2_MSG_USERAUTH_REQUEST (since last: 0.0002, network: 0s)
00000000  00:00:00:09:66:61:5f:31:37:32:32:30:37:00:00:00  ....fa_172207...
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

Almost seems like it doesn't try the password on the first auth attempt, then the server doesn't respond to the second auth attempt.

Any help is greatly appreciated.

@Buddierdl
Copy link
Author

Forgot to mention the exception is "\phpseclib3\Exception\ConnectionClosedException" with the message "No data from server"

@terrafrost
Copy link
Member

terrafrost commented Jan 24, 2024

First, I apologize for the delayed response - I was vacationing in Norway and Iceland (I live in Texas so those countries are a good ways away) for two weeks and just got back.

Anyway,

Almost seems like it doesn't try the password on the first auth attempt, then the server doesn't respond to the second auth attempt.

Correct. It's been doing that since 95d189c because of #1454. As noted in the comments for that commit, that change makes phpseclib's behavior in-line with how PuTTY works. Case in point: here's a PuTTY log transcript from a login I just did: https://pastebin.com/MwVLXkZA

Here's the most relevant snippet from the full log:

Outgoing packet #0x1, type 50 / 0x32 (SSH2_MSG_USERAUTH_REQUEST)
  00000000  00 00 00 06 75 62 75 6e 74 75 00 00 00 0e 73 73  ....ubuntu....ss
  00000010  68 2d 63 6f 6e 6e 65 63 74 69 6f 6e 00 00 00 04  h-connection....
  00000020  6e 6f 6e 65                                      none
Incoming packet #0x2, type 51 / 0x33 (SSH2_MSG_USERAUTH_FAILURE)
  00000000  00 00 00 09 70 75 62 6c 69 63 6b 65 79 00        ....publickey.
Event Log: Offered public key
Outgoing packet #0x2, type 50 / 0x32 (SSH2_MSG_USERAUTH_REQUEST)
  00000000  00 00 00 06 75 62 75 6e 74 75 00 00 00 0e 73 73  ....ubuntu....ss
  00000010  68 2d 63 6f 6e 6e 65 63 74 69 6f 6e 00 00 00 09  h-connection....
  00000020  70 75 62 6c 69 63 6b 65 79 00 00 00 00 0b 73 73  publickey.....ss
  00000030  68 2d 65 64 32 35 35 31 39 00 00 00 33 00 00 00  h-ed25519...3...
  00000040  0b 73 73 68 2d 65 64 32 35 35 31 39 00 00 00 20  .ssh-ed25519... 
  00000050  f1 14 eb a7 f7 2d 1f 97 6b ad b2 b5 13 89 01 7c  .....-..k......|
  00000060  85 61 55 09 ba 17 80 39 d3 c2 3a 5c a8 d6 42 ff  .aU....9..:\..B.

Now, in your case the server is responding by saying that it supports both password and publickey auth. I suppose one possibility is that it's trying to do 2FA in a specific order. Like maybe you need to login with a publickey first and then a password later. Or maybe the server is lying and it doesn't really support password auth even tho it says it does.

The AWS logs might yield more insight. Also, maybe try connecting with PuTTY, since PuTTY is logging in in the exact same way it seems likely that PuTTY would fail too. I mean, sure, in your case, your server only supports password auth whereas in my example, it supports both publickey and password auth, but still.

I'd try it myself on AWS Transfer Family but it's kinda a PITA. AWS Transfer Family isn't free and as such, to minimize my costs, when I've done it in the past, I've created it, from scratch, and then deleted it afterwards. Keeping it up 24/7 so that I'm not having to constantly reconfigure it every time someone has an issue with it would cost me, if memory serves, like $6 / day or about $200 / month, and given I'm not selling phpseclib, paying $200 / month is quite repulsive to me.

Maybe you could give me SFTP access? If so you could email the info to terrafrost@php.net.

edit: https://aws.amazon.com/blogs/opensource/aws-promotional-credits-open-source-projects/ might be an option for me but it sounds like a bit of a PITA. Like I gather the credit is only valid for a year? Travis CI used to be free for FOSS projects but then they started issuing credits that needed to be periodically renewed and it was a sufficient PITA that I just spent a few days migrating to GitHub Actions rather then deal with it. AWS Promotional Credits look to be similar.

@Buddierdl
Copy link
Author

Hi @terrafrost ,

Thanks so much for the reply. Unfortunately I can't give access to the SFTP because it's a third-party source that I don't control. I was trying to troubleshoot with them and they don't see anything relevant in their logs.

I am however able to connect to this SFTP directly from the command line. One possible thing we came up with is the behavior seems similar to what would happen if you just try to SSH into the server. It doesn't support a command shell so the connection is immediately terminated. Is phpseclib trying to open a terminal or similar when it logs in?

Another weird thing is the code seems to work if I run the PHP from the command line instead of it being triggered from a browser.

@Buddierdl
Copy link
Author

@terrafrost ,

So I finally tracked this down. Apparently stream_get_contents() will silently timeout and just return an empty string and that's what was happening here. Could you possible add a way to set that value in your library? The current implementation of setTimeout appears to only affect opening the socket, not reading from it. Here's what fixed my issue:

Screenshot 2024-02-05 at 12 25 13 PM

@terrafrost
Copy link
Member

Does https://github.com/terrafrost/phpseclib/pull/new/3.0-stream-set-timeout still fix the issue for you? I changed up your approach a little bit:

terrafrost@4cadfb6

@Buddierdl
Copy link
Author

Yes, it works good. Thanks for your help.

Are you going to make a new release for this change, or a way I can get it through composer?

@terrafrost
Copy link
Member

First, I need to figure out why this change is causing the unit tests on Ubuntu to fail:

https://github.com/terrafrost/phpseclib/actions/runs/7808725371/job/21299406562

I had no issues on Windows. If I can't reproduce the issue on a local instance of Ubuntu then I'll have to debug it on GitHub Actions, which is prob going to take many hours.

Second, if I can figure that out, I'm willing to add it to the 2.0 / 3.0 / master branches BUT I am less then enthusiastic on making a new release so soon because:

  1. This is a change that's liable to have hard to predict consequences and I'd rather not rush a release with such a change. The unit tests now failing on Ubuntu are exactly the kind of hard to predict consequences that I'm describing. Like I'd rather let several weeks pass while I use phpseclib in various different settings, as new tickets come up, to see if it doesn't cause any issues. Even then I recognize that incorporating this change could be a boon to people (such as yourself) currently having issues but it could also break things for other people (like I said, the consequences are hard to predict).

  2. Even if this was a simple change with easy to predict consequences I'd still be less then enthusiastic about doing a release just for one issue. Like since the last 3.0 release (Dec 28, 2023) a new 3.0 release would contain just two other bug fixes:

    I mean, it's not without precedent for me to do a release a little over a month since I did the last one and with only 3 issues fixed for an issue that doesn't appear to be very widespread so this isn't necessarily a show stopper but still. Like the last thing I want to do is make a new (admittedly minor) release every time I make a commit to the 3.0 branch or any branch, really. Ultimately it is a bit subjective where I draw the line but, still, those are the thoughts that go through my head when I'm considering doing a new release.

@terrafrost
Copy link
Member

The issue on GitHub Actions has been fixed and the code change is in the 2.0 / 3.0 and master branches:

c948a9a

Like I said, tho, I wanna sit on it for a while before releasing a new version.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants