Linux uses lftp file for automatic authentication upload and download

Source: Internet
Author: User

To use sftp for automatic upload (), the lftp tool is referenced.

# Yum install lftp
Installation is complete ..
Lftp-u $ USERNAME, $ PASSWORD sftp: // $ HOST <EOF
Cd $ SFTPBACKUP
Put $ BACKUP/$ DataBakName
Bye
EOF

Log on in the preceding format and an error is returned.
[Root @ just. ssh] # lftp-u qujun, qsc123 sftp: // 192.168.1.104
Lftp qujun@192.168.1.104: ~> Ls
* ** Buffer overflow detected **: lftp terminated
======= Backtrace: ============
/Lib/libc. so.6 (_ fortify_fail + 0x4d) [0xe3bf8d]
/Lib/libc. so.6 (+ 0xf6fca) [0xe39fca]
/Lib/libc. so.6 (+ 0xf66f8) [0xe0000f8]
/Lib/libc. so.6 (_ IO_default_xsputn + 0x13c) [0xdb02cc]
/Lib/libc. so.6 (_ IO_vfprintf + 0x158f) [0xd833af]
/Lib/libc. so.6 (_ vsprintf_chk + 0xa7) [0xe0000a7]


Highlight a token and write the script to execute the same error. Google seems to have no answer from the RedHat forum ..
When we are considering whether to discard this authentication method, a more direct method will pop up:
Use-c Parameters

Lftp-c 'get sftp: // qujun: qsc123@192.168.1.104: 22/c/users/qujun/1.txt'

Actually succeeded .. Well, the next step is to test the use of crontab. It seems that the feedback from various forums is not very useful in scheduled tasks, and the debugging process is still quite long ..

Appendix: How to Use lftp
Lftp settings
Lftp is executed at startup ~ /. Lftprc and ~ /. Lftp/rc. You can add the alias or set command to these two files. If you want to see the complete protocol debugging process, you can use debug to enable debugging.
The system-level Startup File is/etc/lftp. conf.
Lftp has many settings. You can use the set-a command to view all the settings and their values.
Lftp Command Options
-D switch to debug mode
-E commands executes the specified command and does not exit
-P port: Use the execution port for connection
-U user [, pass] uses the username and password used for connection.
-F script_file: Execute the command in the file and exit
-C commands: Execute the specified command and exit.
Environment Variable
The following environment variables will be used by lftp:
HOME ~ Extension
SHELL in! Which shell is used to run the command?
PAGER is used as the page name and is used in the more and zmore commands.
Http_proxy, https_proxy as the initial value of http: proxy, hftp: proxy, https: proxy
Ftp_proxy as the initial ftp: proxy or hftp: proxy value (specified by the URL protocol in the environment variable)
No_proxy as the initial net: no-proxy Value
LFTP_MODULE_PATH is the initial module: path value.
LFTP_HOME is used to locate the directory of the user configuration file. If not set ~ /. Lftp
Related Files
/Etc/lftp. conf system-level Startup File. The actual location is determined by the-sysconfdir configuration item.
~ /. Lftp/rc ,~ The/. lftprc files are executed after/etc/lftp. conf.
~ /. Lftp/log is used to record logs when lftp runs in nohup mode in the background.
~ /. Lftp/bookmarks the user saves the bookmarks in lftp.
~ /. Lftp/cwd_history is used to save the current working directory of each site.
~ /. Netrc is used to save the user name and password of the site.

LFTP details: click here
LFTP: click here

Ubuntu uses LFTP and cRON to automatically back up data to the FTP server every day.

Linux lftp garbled Solution

How to solve Linux lftp garbled code and use bookmarks

LFTP software details

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.