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?