How to make lftp to use key for authentication for sftp on Linux?

Posted on In QA

I have successfully enabled password-less ssh login to a remote server, say example.com with username user.

But when I use lftp to log on the sftp by

lftp sftp://user@example.com

it still asks my password. How it make lftp use my private key to logon the remote lftp server?

There is a little trick to make lftp use your private key for authentication. The key is to pass an empty password to lftp as follows

lftp -u user, sftp://example.com

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

2 comments

  1. Try this : Hope this will solve your problem

    lftp sftp://user:password@host:port -e “get file.name; bye”

Leave a Reply

Your email address will not be published. Required fields are marked *