Lftp with Key + Passphrase

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:

  1. Use keychain
  2. Use sshpass (less secured but probably that meets your requirement)
  3. 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



Leave a reply



Submit