1

I have a centos server s1 and client c1 and I wanted to do a lftp connection with sftp and ssh-key without the password been prompted. Currently when I run the below command the password is prompted even if I have a valid private key mentioned in the lftp command

lftp sftp://centos@ipaddress -e 'set sftp:auto-confirm yes; set sftp:connect-program "ssh -a -x -o StrictHostKeyChecking=no -i /home/centos/ftp-clientloc/id-rsa"; ls' 

From the client side I did the following checks

Tried ssh connection to server with ssh-key and it worked without any password prompted Tried sftp connection to server with ssh-key and it worked without any password prompted Tried lftp connection with sftp and ssh-key , the password is asked and on pressing control + C it stills connects to the server successfully. Server side

PubkeyAuthentication is set to yes in /etc/ssh/sshd_config. PasswordAuthentication no UsePAM no restart the SSH service. How to get rid of the password prompt when connecting with lftp?

1 Answer 1

0

The below link help me fix the issue https://unix.stackexchange.com/a/454738/622738

The easiest way to do this is: lftp -u username, sftp://hostname.

The , character after username does the trick.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.