lftp with key + passphrase
You must specify the username, and just pass anything as the password, to skip it asking.
lftp -u user,xxx sftp://...
sftp equivalent of lftp command returns Permission denied
You seem to be use using FTPS (FTP over TLS/SSL) with lftp
, not SFTP (over SSH).
OpenSSH sftp
is SFTP-only, it does not support FTPS. Those are completely different protocols.
How to run the sftp command with a password from Bash script?
You have a few options other than using public key authentication:
- Use keychain
- Use sshpass (less secured but probably that meets your requirement)
- Use expect (least secured and more coding needed)
If you decide to give sshpass a chance here is a working script snippet to do so:
export SSHPASS=your-password-here
sshpass -e sftp -oBatchMode=no -b - sftp-user@remote-host << !
cd incoming
put your-log-file.log
bye
!
LFTP: save username/password for specific server?
You can use ~/.netrc file or lftp bookmarks.
Add something like this to ~/.netrc:
machine your.server.example.com login your_login password your_password
Then lftp will pick the password when opening ftp://your_login@your.server.example.com, and it will use your_login automatically when opening "your.server.example.com" without the URL syntax.
When using bookmarks, do "set bmk:save-passwords true" (default is false), then save the current session to bookmarks under a name, then "open bookmark_name" will use the login/password pair. The bookmarks file is plain text, so you can even add the URL with login/password by any text editor. To use a common bookmarks for all users set LFTP_HOME environment variable to a common directory.
How do I get lftp to use SSL/TLS security mechanism from the command line?
lftp :~> set ssl-allow false
You've explicitly set ssl-allow to false. But this must be true if lftp should attempt to use SSL.
Related Topics
Ubuntu/Fedora: How to Add Applications in The Menus
Unattended Install of Krb5-User on Ubuntu 16.04
Libv4L2: Error Turning on Stream: No Space Left on Device
Open File in Default Editor from Bash
X11 Forwarding of Gui App in Docker Container
Change Owner of a Currently Running Process
How to Use Performance Counters Inside of The Kernel
How to Set a Global Curl Rate(Speed) Limit
Problems Building Libcurl 7.21.2 on Ubuntu 11.10 (Hiphop)
Alternative to Valgrind (Memcheck) for Finding Leaks on Linux
Compilation Gcc 4.6.2 (Cannot Compute Suffix of Object Files)
How to Avoid Grub Errors After Running Apt-Get Upgrade - Ubuntu
Xargs and Find, Rm Complaining About \N (Newline) in Filename
Joining Line Breaks in Fasta File with Condition in Sed/Awk/Perl One-Liner