I am trying to run duplicity to backup our dataserver to an external server over sftp. My command is as follows:

duplicity --no-encryption /home/dataserver sftp://user@host --ssh-askpass

When i run this i get errored with:

BackendException: ssh connection to user@host failed: No such file or directory: '/home/user/.ssh/known_hosts'
  • 1
    try to run only ssh user@host to create missing file Commented Dec 6, 2018 at 10:15

1 Answer 1


Let's create and fill this file.

Run these commands from user you will run duplicity, for example from dataserver (If your user is already dataserver, then skip first step):

sudo -u dataserver -i
mkdir -m 0700 -p ~/.ssh
ssh-keyscan your-host.example.com >> ~/.ssh/known_hosts

P.S.: It looks like you run duplicity from user account user, so skip first step.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .