Unable to login through SFTP

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.

Unable to login through SFTP

Postby arijit » Tue Aug 20, 2013 10:58 am

Greetings,

We're trying to integrate SSH2 and SFTP2 on an Ubuntu server. We've successfully managed to do this on CentOS earlier. The objective is to implement SSH and SFTP on localhost. The former works fine. However, we're having trouble getting the latter to work. Any help will be deeply appreciated. Thanking you in advance for your consideration.

Log attached for your reference.

PHP also returns the following stack trace:
Code: Select all
PHP Stack trace:
PHP   1. {main}() /home/ipinte5/public_html/test.php:0
PHP   2. ipi_sec_login_user($con_type = 30, $user = 'zf83qcyj', $pass = '4+M(@*Dx', $host = *uninitialized*, $sys = *uninitialized*) /home/ipinte5/public_html/test.php:9
PHP   3. Net_SFTP->login($username = 'zf83qcyj', '4+M(@*Dx') /home/ipinte5/public_html/includes/functions/dsi_ssh_funcs.php:417
PHP   4. user_error('Expected SSH_FXP_VERSION') /usr/share/php/Net/SFTP.php:442
PHP Notice:  fail: unable to authenticate zf83qcyj in /home/ipinte5/public_html/includes/functions/dsi_ssh_funcs.php on line 418
PHP Stack trace:
PHP   1. {main}() /home/ipinte5/public_html/test.php:0
PHP   2. ipi_sec_login_user($con_type = 30, $user = 'zf83qcyj', $pass = '4+M(@*Dx', $host = *uninitialized*, $sys = *uninitialized*) /home/ipinte5/public_html/test.php:9
PHP   3. trigger_error('fail: unable to authenticate zf83qcyj') /home/ipinte5/public_html/includes/functions/dsi_ssh_funcs.php:418


Log:
Code: Select all
<pre>
<-
00000000  53:53:48:2d:32:2e:30:2d:4f:70:65:6e:53:53:48:5f  SSH-2.0-OpenSSH_
00000010  35:2e:39:70:31:20:44:65:62:69:61:6e:2d:35:75:62  5.9p1 Debian-5ub
00000020  75:6e:74:75:31:2e:31:0d:0a                       untu1.1..


</pre>
<pre>
->
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)..


</pre>
<pre>
<- NET_SSH2_MSG_KEXINIT (since last: 0.0601, network: 0.0017s)
00000000  14:84:ff:70:0b:e1:1c:cc:33:96:8d:e6:67:7a:ea:68  ...p....3...gz.h
00000010  4e:00:00:00:b7:65:63:64:68:2d:73:68:61:32:2d:6e  N....ecdh-sha2-n
00000020  69:73:74:70:32:35:36:2c:65:63:64:68:2d:73:68:61  istp256,ecdh-sha
00000030  32:2d:6e:69:73:74:70:33:38:34:2c:65:63:64:68:2d  2-nistp384,ecdh-
00000040  73:68:61:32:2d:6e:69:73:74:70:35:32:31:2c:64:69  sha2-nistp521,di
00000050  66:66:69:65:2d:68:65:6c:6c:6d:61:6e:2d:67:72:6f  ffie-hellman-gro
00000060  75:70:2d:65:78:63:68:61:6e:67:65:2d:73:68:61:32  up-exchange-sha2
00000070  35:36:2c:64:69:66:66:69:65:2d:68:65:6c:6c:6d:61  56,diffie-hellma
00000080  6e:2d:67:72:6f:75:70:2d:65:78:63:68:61:6e:67:65  n-group-exchange
00000090  2d:73:68:61:31:2c:64:69:66:66:69:65:2d:68:65:6c  -sha1,diffie-hel
000000a0  6c:6d:61:6e:2d:67:72:6f:75:70:31:34:2d:73:68:61  lman-group14-sha
000000b0  31:2c:64:69:66:66:69:65:2d:68:65:6c:6c:6d:61:6e  1,diffie-hellman
000000c0  2d:67:72:6f:75:70:31:2d:73:68:61:31:00:00:00:23  -group1-sha1...#
000000d0  73:73:68:2d:72:73:61:2c:73:73:68:2d:64:73:73:2c  ssh-rsa,ssh-dss,
000000e0  65:63:64:73:61:2d:73:68:61:32:2d:6e:69:73:74:70  ecdsa-sha2-nistp
000000f0  32:35:36:00:00:00:9d:61:65:73:31:32:38:2d:63:74  256....aes128-ct
00000100  72:2c:61:65:73:31:39:32:2d:63:74:72:2c:61:65:73  r,aes192-ctr,aes
00000110  32:35:36:2d:63:74:72:2c:61:72:63:66:6f:75:72:32  256-ctr,arcfour2
00000120  35:36:2c:61:72:63:66:6f:75:72:31:32:38:2c:61:65  56,arcfour128,ae
00000130  73:31:32:38:2d:63:62:63:2c:33:64:65:73:2d:63:62  s128-cbc,3des-cb
00000140  63:2c:62:6c:6f:77:66:69:73:68:2d:63:62:63:2c:63  c,blowfish-cbc,c
00000150  61:73:74:31:32:38:2d:63:62:63:2c:61:65:73:31:39  ast128-cbc,aes19
00000160  32:2d:63:62:63:2c:61:65:73:32:35:36:2d:63:62:63  2-cbc,aes256-cbc
00000170  2c:61:72:63:66:6f:75:72:2c:72:69:6a:6e:64:61:65  ,arcfour,rijndae
00000180  6c:2d:63:62:63:40:6c:79:73:61:74:6f:72:2e:6c:69  l-cbc@lysator.li
00000190  75:2e:73:65:00:00:00:9d:61:65:73:31:32:38:2d:63  u.se....aes128-c
000001a0  74:72:2c:61:65:73:31:39:32:2d:63:74:72:2c:61:65  tr,aes192-ctr,ae
000001b0  73:32:35:36:2d:63:74:72:2c:61:72:63:66:6f:75:72  s256-ctr,arcfour
000001c0  32:35:36:2c:61:72:63:66:6f:75:72:31:32:38:2c:61  256,arcfour128,a
000001d0  65:73:31:32:38:2d:63:62:63:2c:33:64:65:73:2d:63  es128-cbc,3des-c
000001e0  62:63:2c:62:6c:6f:77:66:69:73:68:2d:63:62:63:2c  bc,blowfish-cbc,
000001f0  63:61:73:74:31:32:38:2d:63:62:63:2c:61:65:73:31  cast128-cbc,aes1
00000200  39:32:2d:63:62:63:2c:61:65:73:32:35:36:2d:63:62  92-cbc,aes256-cb
00000210  63:2c:61:72:63:66:6f:75:72:2c:72:69:6a:6e:64:61  c,arcfour,rijnda
00000220  65:6c:2d:63:62:63:40:6c:79:73:61:74:6f:72:2e:6c  el-cbc@lysator.l
00000230  69:75:2e:73:65:00:00:00:a7:68:6d:61:63:2d:6d:64  iu.se....hmac-md
00000240  35:2c:68:6d:61:63:2d:73:68:61:31:2c:75:6d:61:63  5,hmac-sha1,umac
00000250  2d:36:34:40:6f:70:65:6e:73:73:68:2e:63:6f:6d:2c  -64@openssh.com,
00000260  68:6d:61:63:2d:73:68:61:32:2d:32:35:36:2c:68:6d  hmac-sha2-256,hm
00000270  61:63:2d:73:68:61:32:2d:32:35:36:2d:39:36:2c:68  ac-sha2-256-96,h
00000280  6d:61:63:2d:73:68:61:32:2d:35:31:32:2c:68:6d:61  mac-sha2-512,hma
00000290  63:2d:73:68:61:32:2d:35:31:32:2d:39:36:2c:68:6d  c-sha2-512-96,hm
000002a0  61:63:2d:72:69:70:65:6d:64:31:36:30:2c:68:6d:61  ac-ripemd160,hma
000002b0  63:2d:72:69:70:65:6d:64:31:36:30:40:6f:70:65:6e  c-ripemd160@open
000002c0  73:73:68:2e:63:6f:6d:2c:68:6d:61:63:2d:73:68:61  ssh.com,hmac-sha
000002d0  31:2d:39:36:2c:68:6d:61:63:2d:6d:64:35:2d:39:36  1-96,hmac-md5-96
000002e0  00:00:00:a7:68:6d:61:63:2d:6d:64:35:2c:68:6d:61  ....hmac-md5,hma
000002f0  63:2d:73:68:61:31:2c:75:6d:61:63:2d:36:34:40:6f  c-sha1,umac-64@o
00000300  70:65:6e:73:73:68:2e:63:6f:6d:2c:68:6d:61:63:2d  penssh.com,hmac-
00000310  73:68:61:32:2d:32:35:36:2c:68:6d:61:63:2d:73:68  sha2-256,hmac-sh
00000320  61:32:2d:32:35:36:2d:39:36:2c:68:6d:61:63:2d:73  a2-256-96,hmac-s
00000330  68:61:32:2d:35:31:32:2c:68:6d:61:63:2d:73:68:61  ha2-512,hmac-sha
00000340  32:2d:35:31:32:2d:39:36:2c:68:6d:61:63:2d:72:69  2-512-96,hmac-ri
00000350  70:65:6d:64:31:36:30:2c:68:6d:61:63:2d:72:69:70  pemd160,hmac-rip
00000360  65:6d:64:31:36:30:40:6f:70:65:6e:73:73:68:2e:63  emd160@openssh.c
00000370  6f:6d:2c:68:6d:61:63:2d:73:68:61:31:2d:39:36:2c  om,hmac-sha1-96,
00000380  68:6d:61:63:2d:6d:64:35:2d:39:36:00:00:00:15:6e  hmac-md5-96....n
00000390  6f:6e:65:2c:7a:6c:69:62:40:6f:70:65:6e:73:73:68  one,zlib@openssh
000003a0  2e:63:6f:6d:00:00:00:15:6e:6f:6e:65:2c:7a:6c:69  .com....none,zli
000003b0  62:40:6f:70:65:6e:73:73:68:2e:63:6f:6d:00:00:00  b@openssh.com...
000003c0  00:00:00:00:00:00:00:00:00:00                    ..........


</pre>
<pre>
-> NET_SSH2_MSG_KEXINIT (since last: 0.3567, network: 0.0015s)
00000000  14:eb:fc:5f:74:bf:69:f1:32:b9:63:c5:fb:5d:6d:1d  ..._t.i.2.c..]m.
00000010  68:00:00:00:36:64:69:66:66:69:65:2d:68:65:6c:6c  h...6diffie-hell
00000020  6d:61:6e:2d:67:72:6f:75:70:31:2d:73:68:61:31:2c  man-group1-sha1,
00000030  64:69:66:66:69:65:2d:68:65:6c:6c:6d:61:6e:2d:67  diffie-hellman-g
00000040  72:6f:75:70:31:34:2d:73:68:61:31:00:00:00:0f:73  roup14-sha1....s
00000050  73:68:2d:72:73:61:2c:73:73:68:2d:64:73:73:00:00  sh-rsa,ssh-dss..
00000060  00:f6:61:72:63:66:6f:75:72:32:35:36:2c:61:72:63  ..arcfour256,arc
00000070  66:6f:75:72:31:32:38:2c:61:72:63:66:6f:75:72:2c  four128,arcfour,
00000080  61:65:73:31:32:38:2d:63:74:72:2c:61:65:73:31:39  aes128-ctr,aes19
00000090  32:2d:63:74:72:2c:61:65:73:32:35:36:2d:63:74:72  2-ctr,aes256-ctr
000000a0  2c:62:6c:6f:77:66:69:73:68:2d:63:74:72:2c:74:77  ,blowfish-ctr,tw
000000b0  6f:66:69:73:68:31:32:38:2d:63:74:72:2c:74:77:6f  ofish128-ctr,two
000000c0  66:69:73:68:31:39:32:2d:63:74:72:2c:74:77:6f:66  fish192-ctr,twof
000000d0  69:73:68:32:35:36:2d:63:74:72:2c:61:65:73:31:32  ish256-ctr,aes12
000000e0  38:2d:63:62:63:2c:61:65:73:31:39:32:2d:63:62:63  8-cbc,aes192-cbc
000000f0  2c:61:65:73:32:35:36:2d:63:62:63:2c:62:6c:6f:77  ,aes256-cbc,blow
00000100  66:69:73:68:2d:63:62:63:2c:74:77:6f:66:69:73:68  fish-cbc,twofish
00000110  31:32:38:2d:63:62:63:2c:74:77:6f:66:69:73:68:31  128-cbc,twofish1
00000120  39:32:2d:63:62:63:2c:74:77:6f:66:69:73:68:32:35  92-cbc,twofish25
00000130  36:2d:63:62:63:2c:74:77:6f:66:69:73:68:2d:63:62  6-cbc,twofish-cb
00000140  63:2c:33:64:65:73:2d:63:74:72:2c:33:64:65:73:2d  c,3des-ctr,3des-
00000150  63:62:63:2c:6e:6f:6e:65:00:00:00:f6:61:72:63:66  cbc,none....arcf
00000160  6f:75:72:32:35:36:2c:61:72:63:66:6f:75:72:31:32  our256,arcfour12
00000170  38:2c:61:72:63:66:6f:75:72:2c:61:65:73:31:32:38  8,arcfour,aes128
00000180  2d:63:74:72:2c:61:65:73:31:39:32:2d:63:74:72:2c  -ctr,aes192-ctr,
00000190  61:65:73:32:35:36:2d:63:74:72:2c:62:6c:6f:77:66  aes256-ctr,blowf
000001a0  69:73:68:2d:63:74:72:2c:74:77:6f:66:69:73:68:31  ish-ctr,twofish1
000001b0  32:38:2d:63:74:72:2c:74:77:6f:66:69:73:68:31:39  28-ctr,twofish19
000001c0  32:2d:63:74:72:2c:74:77:6f:66:69:73:68:32:35:36  2-ctr,twofish256
000001d0  2d:63:74:72:2c:61:65:73:31:32:38:2d:63:62:63:2c  -ctr,aes128-cbc,
000001e0  61:65:73:31:39:32:2d:63:62:63:2c:61:65:73:32:35  aes192-cbc,aes25
000001f0  36:2d:63:62:63:2c:62:6c:6f:77:66:69:73:68:2d:63  6-cbc,blowfish-c
00000200  62:63:2c:74:77:6f:66:69:73:68:31:32:38:2d:63:62  bc,twofish128-cb
00000210  63:2c:74:77:6f:66:69:73:68:31:39:32:2d:63:62:63  c,twofish192-cbc
00000220  2c:74:77:6f:66:69:73:68:32:35:36:2d:63:62:63:2c  ,twofish256-cbc,
00000230  74:77:6f:66:69:73:68:2d:63:62:63:2c:33:64:65:73  twofish-cbc,3des
00000240  2d:63:74:72:2c:33:64:65:73:2d:63:62:63:2c:6e:6f  -ctr,3des-cbc,no
00000250  6e:65:00:00:00:30:68:6d:61:63:2d:73:68:61:31:2d  ne...0hmac-sha1-
00000260  39:36:2c:68:6d:61:63:2d:73:68:61:31:2c:68:6d:61  96,hmac-sha1,hma
00000270  63:2d:6d:64:35:2d:39:36:2c:68:6d:61:63:2d:6d:64  c-md5-96,hmac-md
00000280  35:2c:6e:6f:6e:65:00:00:00:30:68:6d:61:63:2d:73  5,none...0hmac-s
00000290  68:61:31:2d:39:36:2c:68:6d:61:63:2d:73:68:61:31  ha1-96,hmac-sha1
000002a0  2c:68:6d:61:63:2d:6d:64:35:2d:39:36:2c:68:6d:61  ,hmac-md5-96,hma
000002b0  63:2d:6d:64:35:2c:6e:6f:6e:65:00:00:00:04:6e:6f  c-md5,none....no
000002c0  6e:65:00:00:00:04:6e:6f:6e:65:00:00:00:00:00:00  ne....none......
000002d0  00:00:00:00:00:00:00                             .......


</pre>
<pre>
-> NET_SSH2_MSG_KEXDH_INIT (since last: 0.4057, network: 0.0011s)
00000000  1e:00:00:00:81:00:9e:36:cd:1f:0c:15:6b:bd:3b:f6  .......6....k.;.
00000010  f5:dc:f4:f5:54:52:70:02:85:fd:e5:83:e4:dc:6d:5c  ....TRp.......m\
00000020  5d:4a:2b:4f:08:c5:1c:9e:bc:cc:32:97:b0:46:34:55  ]J+O......2..F4U
00000030  6f:a5:bc:3d:46:35:56:e0:a5:2e:5e:58:76:85:84:3f  o..=F5V...^Xv..?
00000040  64:26:04:af:b8:98:6e:5d:bd:aa:b6:0e:ec:47:d7:21  d&....n].....G.!
00000050  92:91:da:f8:5d:7d:56:ce:9d:72:12:55:6f:6b:26:20  ....]}V..r.Uok&
00000060  06:b3:50:de:86:83:1a:6d:38:dd:43:2d:92:99:b7:fc  ..P....m8.C-....
00000070  1e:33:13:86:4e:6e:2f:f3:62:a7:80:03:a5:61:bb:d5  .3..Nn/.b....a..
00000080  e2:7a:31:c0:95:40                                .z1..@


</pre>
<pre>
<- NET_SSH2_MSG_KEXDH_REPLY (since last: 0.0519, network: 0.0011s)
00000000  1f:00:00:01:17:00:00:00:07:73:73:68:2d:72:73:61  .........ssh-rsa
00000010  00:00:00:03:01:00:01:00:00:01:01:00:ee:05:58:8c  ..............X.
00000020  47:cd:de:c6:81:85:40:6e:d5:9c:26:9b:d3:67:97:35  G.....@n..&..g.5
00000030  8d:ab:50:29:b6:27:04:ce:9a:61:5d:df:1f:5f:85:06  ..P).'...a].._..
00000040  af:58:93:dc:8f:27:7f:2c:64:dc:48:55:79:3d:e5:b8  .X...'.,d.HUy=..
00000050  bc:a4:f3:c4:d8:50:c6:c2:86:83:f7:3d:2c:89:28:ac  .....P.....=,.(.
00000060  04:ed:91:9c:34:ce:96:e4:46:e4:23:1e:46:e2:8a:7e  ....4...F.#.F..~
00000070  ba:05:a8:d7:8f:58:4c:a9:2c:ec:f1:2c:b0:d1:83:4d  .....XL.,..,...M
00000080  c3:ed:86:62:45:39:3d:99:96:82:40:ea:03:d3:ff:f8  ...bE9=...@.....
00000090  4d:41:5b:89:30:5c:e5:fb:a5:4e:b8:33:81:55:37:4a  MA[.0\...N.3.U7J
000000a0  b8:77:4f:9e:22:ae:9a:52:ef:b2:a0:3e:28:54:1f:38  .wO."..R...>(T.8
000000b0  f3:2e:5b:74:d1:e2:b2:5e:4e:d7:39:05:18:c9:ad:86  ..[t...^N.9.....
000000c0  bd:1f:1e:30:5d:19:47:5e:fb:69:e4:f1:aa:7d:8f:ca  ...0].G^.i...}..
000000d0  c8:04:59:44:86:33:43:c8:dd:bb:6a:b2:ab:5b:07:0d  ..YD.3C...j..[..
000000e0  45:46:af:72:66:e2:31:d5:1c:ac:cf:b8:3d:b3:67:1b  EF.rf.1.....=.g.
000000f0  12:55:6c:30:db:7d:1c:7c:11:49:8f:ac:1e:62:b6:ee  .Ul0.}.|.I...b..
00000100  5d:3f:e7:ba:55:8a:36:63:ae:81:14:57:25:f7:f3:b8  ]?..U.6c...W%...
00000110  67:13:9f:7f:64:75:1b:73:cc:5c:0a:e7:00:00:00:81  g...du.s.\......
00000120  00:de:67:35:cd:49:3b:6f:5a:93:35:28:ee:72:91:9c  ..g5.I;oZ.5(.r..
00000130  28:0b:c0:23:16:6e:6a:9b:7d:86:fe:8e:68:6f:64:97  (..#.nj.}...hod.
00000140  13:be:f3:2b:4d:03:e2:d5:c9:c7:f5:cb:18:47:36:0e  ...+M........G6.
00000150  d8:e9:0d:50:4b:a5:40:a8:5e:17:e3:18:65:a8:7f:e6  ...PK.@.^...e...
00000160  76:6d:bb:8e:c1:7a:99:54:81:f1:48:18:ad:3e:e7:50  vm...z.T..H..>.P
00000170  bc:51:f5:81:66:ca:01:95:d3:e2:0e:3f:42:79:66:42  .Q..f......?ByfB
00000180  b6:4b:84:40:b4:f1:ae:e5:24:2a:39:03:0e:c4:45:ac  .K.@....$*9...E.
00000190  74:11:1b:42:84:e0:8e:52:67:38:7e:40:ff:3d:e2:fe  t..B...Rg8~@.=..
000001a0  a2:00:00:01:0f:00:00:00:07:73:73:68:2d:72:73:61  .........ssh-rsa
000001b0  00:00:01:00:92:fe:5f:14:1c:79:a8:09:eb:3d:46:62  ......_..y...=Fb
000001c0  8f:5e:2a:d9:0d:8b:88:35:d5:c1:95:eb:4b:23:e1:3f  .^*....5....K#.?
000001d0  84:38:37:9b:52:ce:0e:e2:a8:bf:c7:b3:07:49:e6:5e  .87.R........I.^
000001e0  8d:cc:69:c4:5f:cf:9c:44:8e:de:70:ca:dd:ce:6f:8f  ..i._..D..p...o.
000001f0  dc:e5:29:ea:a8:9c:59:9c:61:ef:c5:51:bb:96:d9:53  ..)...Y.a..Q...S
00000200  59:80:f2:e4:26:16:2e:62:d2:e4:42:cc:c1:cf:a5:f0  Y...&..b..B.....
00000210  1e:cc:b7:f9:e3:1e:b8:bd:7a:b7:84:ed:33:43:45:38  ........z...3CE8
00000220  78:17:77:0a:81:8f:76:c7:f8:b6:a7:68:f0:4c:1c:3f  x.w...v....h.L.?
00000230  ba:08:90:9c:9d:eb:3b:7b:50:91:a9:b7:c0:64:ae:cb  ......;{P....d..
00000240  dc:31:36:c6:44:1f:5d:a7:a6:80:64:23:1e:71:f7:9d  .16.D.]...d#.q..
00000250  41:86:7c:9a:a6:26:96:fb:38:f8:74:f3:1f:d3:4b:06  A.|..&..8.t...K.
00000260  e0:07:ab:43:00:5a:34:05:44:a8:6b:5a:5d:39:5d:ac  ...C.Z4.D.kZ]9].
00000270  d8:c5:14:1d:14:78:de:cd:65:fe:61:53:a8:db:d2:84  .....x..e.aS....
00000280  a8:33:b5:30:c4:a2:84:56:87:79:dd:4a:60:8f:cc:8b  .3.0...V.y.J`...
00000290  f6:b1:bd:2a:ee:8b:0d:1d:91:c0:2a:64:26:af:8c:7d  ...*......*d&..}
000002a0  ce:d6:49:a6:6f:26:75:ef:63:8b:f0:54:ec:c6:73:b8  ..I.o&u.c..T..s.
000002b0  62:08:ad:05                                      b...


</pre>
<pre>
-> NET_SSH2_MSG_NEWKEYS (since last: 0.3898, network: 0.0004s)
00000000  15                                               .


</pre>
<pre>
<- NET_SSH2_MSG_NEWKEYS (since last: 0.0044, network: 0.001s)
00000000  15                                               .


</pre>
<pre>
-> NET_SSH2_MSG_SERVICE_REQUEST (since last: 0.0403, network: 0.0004s)
00000000  05:00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74  .....ssh-useraut
00000010  68                                               h


</pre>
<pre>
<- NET_SSH2_MSG_SERVICE_ACCEPT (since last: 0.0109, network: 0.0012s)
00000000  06:00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74  .....ssh-useraut
00000010  68                                               h


</pre>
<pre>
-> NET_SSH2_MSG_USERAUTH_REQUEST (since last: 0.011, network: 0.0004s)
00000000  32:00:00:00:08:7a:66:38:33:71:63:79:6a:00:00:00  2....zf83qcyj...
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  34:2b:4d:28:40:2a:44:78                          4+M(@*Dx


</pre>
<pre>
<- NET_SSH2_MSG_USERAUTH_SUCCESS (since last: 0.0246, network: 0.0012s)
00000000  34                                               4


</pre>
<pre>
-> NET_SSH2_MSG_CHANNEL_OPEN (since last: 0.0083, network: 0.0004s)
00000000  5a:00:00:00:07:73:65:73:73:69:6f:6e:00:00:00:02  Z....session....
00000010  7f:ff:ff:ff:00:00:40:00                          ......@.


</pre>
<pre>
<- NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION (since last: 0.7292, network: 0.7123s)
00000000  5b:00:00:00:02:00:00:00:00:00:00:00:00:00:00:80  [...............
00000010  00                                               .


</pre>
<pre>
-> NET_SSH2_MSG_CHANNEL_REQUEST (since last: 0.0145, network: 0.0024s)
00000000  62:00:00:00:00:00:00:00:09:73:75:62:73:79:73:74  b........subsyst
00000010  65:6d:01:00:00:00:04:73:66:74:70                 em.....sftp


</pre>
<pre>
<- NET_SSH2_MSG_CHANNEL_WINDOW_ADJUST (since last: 0.0147, network: 0.0013s)
00000000  5d:00:00:00:02:00:20:00:00                       ]..... ..


</pre>
<pre>
<- NET_SSH2_MSG_CHANNEL_SUCCESS (since last: 0.0078, network: 0.0012s)
00000000  63:00:00:00:02                                   c....


</pre>
<pre>
-> NET_SSH2_MSG_CHANNEL_DATA (since last: 0.007, network: 0.0004s)
00000000  5e:00:00:00:00:00:00:00:09:00:00:00:05:01:00:00  ^...............
00000010  00:03                                            ..


</pre>
<pre>
-> NET_SFTP_INIT (0.0109s)
00000000  00:00:00:03                                      ....


</pre>
<pre>
<- NET_SSH2_MSG_CHANNEL_EOF (since last: 0.0147, network: 0.0012s)
00000000  60:00:00:00:02                                   `....


</pre>
<pre>
<- NET_SSH2_MSG_CHANNEL_REQUEST (since last: 0.0073, network: 0.0012s)
00000000  62:00:00:00:02:00:00:00:0b:65:78:69:74:2d:73:74  b........exit-st
00000010  61:74:75:73:00:00:00:00:7f                       atus.....


</pre>
<pre>
-> NET_SSH2_MSG_CHANNEL_EOF (since last: 0.0141, network: 0.0003s)
00000000  60:00:00:00:00                                   `....


</pre>
<pre>
-> NET_SSH2_MSG_CHANNEL_CLOSE (since last: 0.0056, network: 0.0004s)
00000000  61:00:00:00:00                                   a....


</pre>
<pre>
<- NET_SSH2_MSG_CHANNEL_CLOSE (since last: 0.0065, network: 0.0013s)
00000000  61:00:00:00:02                                   a....


</pre>
<pre>
-> NET_SSH2_MSG_DISCONNECT (since last: 0.0077, network: 0.0004s)
00000000  01:00:00:00:0b:00:00:00:00:00:00:00:00           .............


</pre>
arijit
Traveler
 
Posts: 4
Joined: Tue Aug 20, 2013 10:44 am

Re: Unable to login through SFTP

Postby TerraFrost » Tue Aug 20, 2013 8:23 pm

So it's logging you in just fine - it's just that the server is sending an "exit-status" SSH channel request right after phpseclib sends it's SSH_FXP_VERSION packet.

Can you SFTP in with psftp? If so if you could get me the logs for that that'd be great.

You can enable logging by going to PuTTY->Session->Logging and checking the "SSH packets" radio button. Then save the session and then go to psftp and load the session by doing something like "psftp -load sessionName" or something.
TerraFrost
Legendary Guard
 
Posts: 12357
Joined: Wed Dec 04, 2002 6:37 am

Re: Unable to login through SFTP

Postby arijit » Fri Aug 23, 2013 8:26 am

Thank you for your response and apologies for this delay.

We just figured out what was going wrong. We're trying to log users in to a chrooted jail. However, the jail setup did not have necessary configurations for supporting an sFTP. Once we got that in - /usr/lib/sftp-server, /usr/libexec/openssh/sftp-server, /usr/lib/misc/sftp-server, /usr/libexec /sftp-server, /usr/lib/openssh/sftp-server (for Ubuntu) - things started working fine.

I hope that this may prove useful for non-experts working with chrooted jails and facing similar problems.

Thank you again for your response.
arijit
Traveler
 
Posts: 4
Joined: Tue Aug 20, 2013 10:44 am


Return to phpseclib support

Who is online

Users browsing this forum: No registered users and 2 guests

cron