I want to backup server files automatically,so I try to do it with rsync
. I use below command to ssh login passwordless.
ssk-keygen
ssh-copy-id [email protected]
ssh-copy-id [email protected]
But when I use rsync
, it prompt me to input the passwd.
Note: CentOS Linux release 7.5.1804 (Core)
Is that possible that you use wrong key? Because on your screenshot, when you connected through ssh, you connect without entering password for your ssh key. But when you try use rsync and specify path to key. Your key requests password.
And why you put path to pub key? You should put there path to your private key:
/home/lufei/.ssh/id_rsa
.When you generate ssh key pair, your private key stays on host where it was generated. Public key is sent to host you want connect. So, when you want specify path to key for ssh connection, you need use your private key.