2

I am trying to upload my first duplicity backup to a remote server and it fails. It is the first time I am using the tool and it did not work before.

duplicity /home/me/Documents/ scp://me@<ip-address>//home/me/bak

This is the answer I get:

BackendException: ssh connection to me@<ip-address>:22 failed: Private key file is encrypted
DEBUG:duplicity:BackendException: ssh connection to me@<ip-address>:22 failed: Private key file is encrypted

Logging in via ssh works fine.

I have searched the web but could not find any possible solution. My only hunch is that it could be related to my .ssh directory: which contains multiple identities and thus multiple .pub and key files

EDIT: with -v 9 I get the following output (a lot more, but just showing last part):

ssh: Kex agreed: curve25519-sha256@libssh.org
DEBUG:sshbackend:Kex agreed: curve25519-sha256@libssh.org
ssh: HostKey agreed: ssh-ed25519
DEBUG:sshbackend:HostKey agreed: ssh-ed25519
ssh: Cipher agreed: aes128-ctr
DEBUG:sshbackend:Cipher agreed: aes128-ctr
ssh: MAC agreed: hmac-sha2-256
DEBUG:sshbackend:MAC agreed: hmac-sha2-256
ssh: Compression agreed: none
DEBUG:sshbackend:Compression agreed: none
ssh: kex engine KexCurve25519 specified hash_algo <built-in function openssl_sha256>
DEBUG:sshbackend:kex engine KexCurve25519 specified hash_algo <built-in function openssl_sha256>
ssh: Switch to new keys ...
DEBUG:sshbackend:Switch to new keys ...
Using temporary directory /tmp/duplicity-O8U6r5-tempdir
Level 5:duplicity:Using temporary directory /tmp/duplicity-O8U6r5-tempdir
Backend error detail: Traceback (innermost last):
  File "/usr/bin/duplicity", line 1581, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1567, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1406, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python2.7/site-packages/duplicity/commandline.py", line 1140, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/usr/lib/python2.7/site-packages/duplicity/commandline.py", line 1015, in set_backend
    globals.backend = backend.get_backend(bend)
  File "/usr/lib/python2.7/site-packages/duplicity/backend.py", line 223, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/lib/python2.7/site-packages/duplicity/backend.py", line 209, in get_backend_object
    return factory(pu)
  File "/usr/lib/python2.7/site-packages/duplicity/backends/ssh_paramiko_backend.py", line 240, in __init__
    self.config['port'], e))
 BackendException: ssh connection to me@<ip-address>:22 failed: Private key file is encrypted

doesn't tell me much more though

transient_loop
  • 499
  • 1
  • 4
  • 15

3 Answers3

2

seems like the paramiko backend does not support providing a passphrase for your secret key currently.

try pexpect+scp:// or better pexpect+sftp:// if possible

alternatively specify a secret key you want to use via

--ssh-options="-oIdentityFile='/my/backup/id'"

and make sure it is not passphrase protected.

..ede/duply.net

ede
  • 21
  • 1
0

I had similar problem with a passphrase key. Setting the key to the following two environment variables solved it for me: FTP_PASSWORD and PASSPHRASE

https://duplicity.readthedocs.io/en/latest/duplicity.backends.ssh_paramiko_backend.html

Boris
  • 1
0

What actually worked is using rsync as backend.

Which is finally surprising, I have no idea why the scp backend did not work, as pure scp works too.

Won't accept my own answer because it is not really the solution to the problem, just a workaround. But at least I can use it now.

transient_loop
  • 499
  • 1
  • 4
  • 15