I want to back up my system to a remote server through SCP using Duplicity. However, I use key-based authentication. How could I do this?
like you would with ssh itself. duplicity allows you to define ssh options (from the man page)
--ssh-options options Allows you to pass options to the ssh backend. Can be specified multiple times or as a space separated options list. The options list should be of the form "-oOpt1=’parm1’ -oOpt2=’parm2’" where the option string is quoted and the only spaces allowed are between options. The option string will be passed verbatim to both scp and sftp, whose command line syntax differs slightly hence the options should therefore be given in the long option format described in ssh_config(5) . example of a list:
duplicity --ssh-options="-oProtocol=2 -oIdentityFile=’/my/backup/id’" /home/me scp://user@host/some_dir
example with multiple parameters:
duplicity --ssh-options="-oProtocol=2" --ssh-options="-oIdentityFile=’/my/backup/id’"
NOTE: The ssh paramiko backend currently supports only the -i or -oIdentityFile setting. If needed provide more host specific options via ssh_config file.