I need to make periodic backups of a directory on a remote server which is a virtual machine hosted by a research organisation. They mandate that access to VMs is through ssh keys, which is all good, except that I can't figure out how to point rsync to the ssh key for this server.
Rsync has no problem if the key file is
~/.ssh/id_rsa, but when it is something else I get
Permission denied (publickey).
With ssh I can specify the identity file with
-i, but rsync appears to have no such option.
I have also tried temporarily moving the key on the local machine to
~/.ssh/id_rsa, but that similarly does not work.
Can you specify an identity file with rsync?