I’m trying to backup my files with SFTP.
I understand that to automate the process, I have to use SSH key in order for Restic to log in to my sftp passwordless.
I created my keys, and i’m able to connect to my remote server from my source server using the command :
ssh user@myremoteserver without having to provide a password anymore, which mean that my SSH public key is trusted. (And I can find it in ~/.ssh/authorized_keys)
But when I try to backup my files with restic, it keeps asking for the sftp password, and I don’t understand why.
The command i’m using is the following :
sudo restic -r sftp:user@myremoteserver:BACKUPS backup apps --password-file=restic-password and it results in "user@myremoteserver’s password: " prompt.
On my source server, if I try to use
sftp user@myremoteserver it also prompt for password, but if I leave it blank it will end up connecting with ssh, but will not using restic : “user@myremoteserver’s password: subprocess ssh: Permission denied, please try again.”
I have no idea what to do