Discussion:
Debian wheeze built of lftp 4.3.6 and SFTP
Mateusz Loskot
2012-11-09 21:52:16 UTC
Permalink
Hi,

I'm having a strange problem trying to connect with a server
over SFTP using two similar versions of lftp,
but on two different Linux environments:

1) Arch Linux (x64)

$ lftp --version | egrep 'Version|Libraries'
LFTP | Version 4.4.0 | Copyright (c) 1996-2012 Alexander V. Lukyanov
Libraries used: Readline 6.2, Expat 2.1.0, GnuTLS 3.1.3, zlib 1.2.7

$ ldd `which lftp`
linux-vdso.so.1 (0x00007ffff65ff000)
libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007f1efbcdb000)
libgnutls.so.28 => /usr/lib/libgnutls.so.28 (0x00007f1efb9d5000)
librt.so.1 => /usr/lib/librt.so.1 (0x00007f1efb7cd000)
libreadline.so.6 => /usr/lib/libreadline.so.6 (0x00007f1efb587000)
libutil.so.1 => /usr/lib/libutil.so.1 (0x00007f1efb384000)
libncursesw.so.5 => /usr/lib/libncursesw.so.5 (0x00007f1efb127000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f1efaf23000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f1efad0e000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f1efa967000)
/lib/ld-linux-x86-64.so.2 (0x00007f1efbf05000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f1efa74b000)
libz.so.1 => /usr/lib/libz.so.1 (0x00007f1efa535000)
libp11-kit.so.0 => /usr/lib/libp11-kit.so.0 (0x00007f1efa321000)
libtasn1.so.6 => /usr/lib/libtasn1.so.6 (0x00007f1efa10f000)
libnettle.so.4 => /usr/lib/libnettle.so.4 (0x00007f1ef9ee9000)
libhogweed.so.2 => /usr/lib/libhogweed.so.2 (0x00007f1ef9cd6000)
libgmp.so.10 => /usr/lib/libgmp.so.10 (0x00007f1ef9a67000)


2) Debian wheezy (32-bit)

$ lftp --version | egrep 'Version|Libraries'
LFTP | Version 4.3.6 | Copyright (c) 1996-2012 Alexander V. Lukyanov
Libraries used: Readline 6.2, GnuTLS 2.12.20, zlib 1.2.7

$ ldd `which lftp`
libgnutls.so.26 => /usr/lib/i386-linux-gnu/libgnutls.so.26 (0xb7ec5000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb7ebc000)
libreadline.so.6 => /lib/i386-linux-gnu/libreadline.so.6 (0xb7e7d000)
libutil.so.1 => /lib/i386-linux-gnu/libutil.so.1 (0xb7e79000)
libtinfo.so.5 => /lib/i386-linux-gnu/libtinfo.so.5 (0xb7e59000)
libresolv.so.2 => /lib/i386-linux-gnu/libresolv.so.2 (0xb7e44000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb7e40000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb7e22000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7cd9000)
/lib/ld-linux.so.2 (0xb7f96000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb7cc0000)
libtasn1.so.3 => /usr/lib/i386-linux-gnu/libtasn1.so.3 (0xb7cae000)
libgcrypt.so.11 => /lib/i386-linux-gnu/libgcrypt.so.11 (0xb7c29000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb7c0f000)
libp11-kit.so.0 => /usr/lib/i386-linux-gnu/libp11-kit.so.0 (0xb7bfd000)
libgpg-error.so.0 => /lib/i386-linux-gnu/libgpg-error.so.0 (0xb7bf9000)


I issue simple commands: connect
lftp sftp://myuser:***@example.com
then ls to list.

The strange thing is that everything works very well in 1) case.
In case 2) on Debian, it lftp hangs connecting:

~> ls
`ls' at 0 [Connecting...]

and I only can interrupt.

I assume SFTP should work in both environments as both have
GnuTLS support. Isn't it?


On the 2) system, Debian, I've tried to build lftp from git sources,
but I hit the wall with gnutls >= 1.0.0 configure error:

https://github.com/lavv17/lftp/issues/24

Could anyone shed some light on the hanging connection problem?

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Alexander V. Lukyanov
2012-11-13 09:42:57 UTC
Permalink
Post by Mateusz Loskot
I issue simple commands: connect
then ls to list.
The strange thing is that everything works very well in 1) case.
~> ls
`ls' at 0 [Connecting...]
and I only can interrupt.
I assume SFTP should work in both environments as both have
GnuTLS support. Isn't it?
sftp does not use gnutls at all, it calls ssh to connect to remote server.
Try to run ssh yourself and connect to the server.

You can also try to turn on debug in lftp and see what happens.
--
Alexander.
Mateusz Loskot
2012-11-13 17:00:37 UTC
Permalink
Post by Alexander V. Lukyanov
Post by Mateusz Loskot
I issue simple commands: connect
then ls to list.
The strange thing is that everything works very well in 1) case.
~> ls
`ls' at 0 [Connecting...]
and I only can interrupt.
I assume SFTP should work in both environments as both have
GnuTLS support. Isn't it?
sftp does not use gnutls at all, it calls ssh to connect to remote server.
Try to run ssh yourself and connect to the server.
Now I see, I wasn't sure about that.
The server I'm trying to reach does not allow shell access (scp/ssh is
not allowed),
so I can only connect through sftp (not ftps).

The problem above is not solved. It was caused by connection timeout,
because the server was discarding connections.

Sorry for false alarm and thanks for help!

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Loading...