LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Error dowloading with lftp from sftp server: get: Access failed: No such file (https://www.linuxquestions.org/questions/linux-newbie-8/error-dowloading-with-lftp-from-sftp-server-get-access-failed-no-such-file-4175449246/)

dgerber 02-08-2013 08:20 PM

Error dowloading with lftp from sftp server: get: Access failed: No such file
 
I've successfully set up lftp upload (put) programs with another vendor on our servers via almost identical shell scripts but am having issues with a download (get/mirror) process. I can connect - list the directory..but when I attempt to get, mget or mirror the file - I receive the error:

get: Access failed: No such file

We have an inhouse server that has working lftp get scripts (using the mirror command) to an sftp server here at BDSC - so I
modified my programs to mirror these programs just to try a true test and still get the same error (s) from the vendor's server :


[root] atm:/stec/net/custom> vi lftpfilemain.ss

/stec/net/custom/lftpfile1.ss


[root] atm:/stec/net/custom> vi lftpfile1.ss

lftp -u "USER,PASS" sftp://208.72.248.104 <<EOF
lcd /tmp/atm
mirror -r
EOF
~

[root] atm:/stec/net/custom> /stec/net/custom/lftpfilemain.ss
mirror: Access failed: No such file (ET584369)
*********************************

I then tried running the same programs, redirected only to our SFTP server (placing a file with the same name on the server) - and it successfully downloaded to the CUs server.

We are able to successfully downlaod the file via a straigt sftp command line prompt.. but not via a lftp sftp command line..

[root] atm:/stec/net/custom> sftp K584369R@208.72.248.104
Connecting to 208.72.248.104...
"WARNING! THIS SYSTEM IS FOR AUTHORIZED USE ONLY! The information on this comput
er and network is the property of a private corporation and is protected by inte
llectual property rights. You must be assigned an account on this computer to ac
cess information and are only allowed to access information as defined by the sy
stem administrators. Use of company resources should be for business purposes on
ly and should be in compliance with the Code of Conduct and company policies and
procedures. As the property of a private corporation, your activities may be mo
nitored and/or recorded and you should have no expectation of privacy on this co
mputer and its networks. All actions are monitored and recorded. Use of this com
puter implies consent to monitoring and recording. CP2"
K584369R@208.72.248.104's password:
sftp> lcd /tmp/atm
sftp> get ET584369
Fetching /KONEECU-SITE/ET584369 to ET584369
/KONEECU-SITE/ET584369 81% 367KB 80.5KB/s 00:01 ETA
sftp> quit


I am STUMPED!

***********************************
I'm not a big fan of "the WIKI" but the only other thing that I've found is an article that refers to using lftp as an sftp client and the need for libssl in the library.


I listed the linked libraries and I don't see libssl in their ldd output.. do you think this could possibly be the issue?




http://how-to.wikia.com/wiki/How_to_..._a_sftp_client



How to use lftp as a sftp client Edit History Talk 0
1,772pages on
this wiki lftp is a very powerful and user friendly command line ftp client. It can also be used with many other protocols such as SFTP.



Check to see if lftp is compiled for sftp supportEdit1.find where lftp is installed
■type which lftp
example output: /usr/local/bin/lftp
2.Check linked libraries
■Execute: ldd /usr/local/bin/lftp
■Example output:
linux-gate.so.1 => (0xffffe000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0xb7f8e000)
libssl.so.0.9.7 => /usr/lib/libssl.so.0.9.7 (0xb7f5c000)
libcrypto.so.0.9.7 => /usr/lib/libcrypto.so.0.9.7 (0xb7e58000)
libreadline.so.5 => /lib/libreadline.so.5 (0xb7e28000)
libutil.so.1 => /lib/libutil.so.1 (0xb7e24000)
libncurses.so.5 => /lib/libncurses.so.5 (0xb7de2000)
libresolv.so.2 => /lib/libresolv.so.2 (0xb7dd0000)
libdl.so.2 => /lib/libdl.so.2 (0xb7dcb000)
libm.so.6 => /lib/tls/libm.so.6 (0xb7da8000)
libgcc_s.so.1 => /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/libgcc_s.so.1 (0xb7d9f000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7c88000)
/lib/ld-linux.so.2 (0xb7fbc000)
3.To use sftp with lftp
■libssl must show like above.
libssl.so.0.9.7 => /usr/lib/libssl.so.0.9.7 (0xb7f5c000)
■the version and other info does not need to be the same but libssl must appear
■if libssl is not listed.
1.install SSL (sudo apt-get install libssl-dev)
2.recompile lftp with ssl support




/usr/bin/lftp
[root] atm:/stec/net/custom> ldd /usr/bin/lftp
libreadline.so.4 => /usr/lib/libreadline.so.4 (0x05ab5000)
libutil.so.1 => /lib/libutil.so.1 (0x00197000)
libncurses.so.5 => /usr/lib/libncurses.so.5 (0x00782000)
libresolv.so.2 => /lib/libresolv.so.2 (0x0072f000)
libdl.so.2 => /lib/libdl.so.2 (0x00580000)
libm.so.6 => /lib/tls/libm.so.6 (0x0055b000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00111000)
libc.so.6 => /lib/tls/libc.so.6 (0x0042a000)
/lib/ld-linux.so.2 (0x0040b000)
[root] atm:/stec/net/custom>


All times are GMT -5. The time now is 12:02 AM.