duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Duplicity-talk] Can't use duplicity sftp


From: edgar . soldin
Subject: Re: [Duplicity-talk] Can't use duplicity sftp
Date: Sun, 17 Apr 2022 15:14:48 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0

hey Julien,

see my comments below

On 17.04.2022 12:19, Julien Henry via Duplicity-talk wrote:
Hello,

I can't use duplicity (0.7.17) with SFTP to make backups on a Synology
NAS. I want to use cron to automate the backups. But before this, I
want to check if the backups can work from command line.
My computer is using Trisquel 9.
I can connect to the NAS with SFTP with PCManFM or with the sftp
command.
But when I try using duplicity I firstly had a problem with
"BackendException: ssh connection to Julien@192.168.10.3:22 failed: No
authentication methods available" as you can see below.

how exactly are you connecting via sftp command line? can you give an example 
where access/auth works for you? are you using key auth?

julien@julien-Latitude-E7440:~$ duplicity -v9 --allow-source-mismatch
--full-if-older-than 1M /bin --force
sftp://Julien@192.168.10.3/sauvegardes/Nouveau gpg: Attention : les
droits du répertoire personnel « /home/julien/.gnupg » ne sont pas sûrs
Utilisation du répertoire
d’archive : /home/julien/.cache/duplicity/1b9cd978807cebd8b01e39c55cccdeff
Utilisation du nom de sauvegarde : 1b9cd978807cebd8b01e39c55cccdeff Le
binaire GPG est gpg, version 2.2.4 Importation de
duplicity.backends.acdclibackend Succeeded Importation de
duplicity.backends.azurebackend Succeeded Importation de
duplicity.backends.b2backend Succeeded Importation de
duplicity.backends.botobackend Succeeded Importation de
duplicity.backends.cfbackend Succeeded Importation de
duplicity.backends.dpbxbackend Failed: No module named dropbox
Importation de duplicity.backends.gdocsbackend Succeeded Importation de
duplicity.backends.giobackend Succeeded Importation de
duplicity.backends.hsibackend Succeeded Importation de
duplicity.backends.hubicbackend Succeeded Importation de
duplicity.backends.imapbackend Succeeded Importation de
duplicity.backends.lftpbackend Succeeded Importation de
duplicity.backends.localbackend Succeeded Importation de
duplicity.backends.mediafirebackend Succeeded Importation de
duplicity.backends.megabackend Succeeded Importation de
duplicity.backends.multibackend Succeeded Importation de
duplicity.backends.ncftpbackend Succeeded Importation de
duplicity.backends.onedrivebackend Succeeded Importation de
duplicity.backends.par2backend Succeeded Importation de
duplicity.backends.pydrivebackend Succeeded Importation de
duplicity.backends.rsyncbackend Succeeded Importation de
duplicity.backends.ssh_paramiko_backend Succeeded Importation de
duplicity.backends.ssh_pexpect_backend Succeeded Importation de
duplicity.backends.swiftbackend Succeeded Importation de
duplicity.backends.sxbackend Succeeded Importation de
duplicity.backends.tahoebackend Succeeded Importation de
duplicity.backends.webdavbackend Succeeded ssh: starting thread (client
mode): 0xc8240a10L ssh: Local version/idstring: SSH-2.0-paramiko_2.0.0
ssh: Remote version/idstring: SSH-2.0-OpenSSH_7.4 ssh: Connected
(version 2.0, client OpenSSH_7.4) ssh: kex algos:[u'curve25519-sha256',
u'curve25519-sha256@libssh.org', u'ecdh-sha2-nistp256',
u'ecdh-sha2-nistp384', u'ecdh-sha2-nistp521',
u'diffie-hellman-group-exchange-sha256',
u'diffie-hellman-group16-sha512', u'diffie-hellman-group18-sha512',
u'diffie-hellman-group14-sha256', u'diffie-hellman-group14-sha1']
server key:[u'ssh-rsa', u'rsa-sha2-512', u'rsa-sha2-256',
u'ecdsa-sha2-nistp256', u'ssh-ed25519'] client
encrypt:[u'chacha20-poly1305@openssh.com', u'aes128-ctr',
u'aes192-ctr', u'aes256-ctr', u'aes128-gcm@openssh.com',
u'aes256-gcm@openssh.com'] server
encrypt:[u'chacha20-poly1305@openssh.com', u'aes128-ctr',
u'aes192-ctr', u'aes256-ctr', u'aes128-gcm@openssh.com',
u'aes256-gcm@openssh.com'] client mac:[u'umac-64-etm@openssh.com',
u'umac-128-etm@openssh.com', u'hmac-sha2-256-etm@openssh.com',
u'hmac-sha2-512-etm@openssh.com', u'hmac-sha1-etm@openssh.com',
u'umac-64@openssh.com', u'umac-128@openssh.com', u'hmac-sha2-256',
u'hmac-sha2-512', u'hmac-sha1'] server mac:[u'umac-64-etm@openssh.com',
u'umac-128-etm@openssh.com', u'hmac-sha2-256-etm@openssh.com',
u'hmac-sha2-512-etm@openssh.com', u'hmac-sha1-etm@openssh.com',
u'umac-64@openssh.com', u'umac-128@openssh.com', u'hmac-sha2-256',
u'hmac-sha2-512', u'hmac-sha1'] client compress:[u'none',
u'zlib@openssh.com'] server compress:[u'none', u'zlib@openssh.com']
client lang:[u''] server lang:[u''] kex follows?False ssh: Kex agreed:
diffie-hellman-group-exchange-sha256 ssh: Cipher agreed: aes128-ctr
ssh: MAC agreed: hmac-sha2-256 ssh: Compression agreed: none ssh: Got
server p (8192
bits) /usr/lib/python2.7/dist-packages/paramiko/rsakey.py:119:
DeprecationWarning: signer and verifier have been deprecated. Please
use sign and verify instead. algorithm=hashes.SHA1(), ssh: kex engine
KexGexSHA256 specified hash_algo <built-in function openssl_sha256>
ssh: Switch to new keys ... Utilisation du dossier
temporaire /tmp/duplicity-0UYC7c-tempdir Détails de l’erreur de
sauvegarde : Traceback (innermost last): File "/usr/bin/duplicity",
line 1555, in <module> with_tempdir(main) File "/usr/bin/duplicity",
line 1541, in with_tempdir fn() File "/usr/bin/duplicity", line 1380,
in main action = commandline.ProcessCommandLine(sys.argv[1:]) File
"/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1135,
in ProcessCommandLine backup, local_pathname = set_backend(args[0],
args[1]) File
"/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1010,
in set_backend globals.backend = backend.get_backend(bend) File
"/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 223, in
get_backend obj = get_backend_object(url_string) File
"/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 209, in
get_backend_object return factory(pu) File
"/usr/lib/python2.7/dist-packages/duplicity/backends/ssh_paramiko_backend.py",
line 235, in __init__ self.config['port'], e)) BackendException: ssh
connection to Julien@192.168.10.3:22 failed: No authentication methods
available

BackendException: ssh connection to Julien@192.168.10.3:22 failed: No
authentication methods available ssh: EOF in transport thread

did you try providing te passphrase via env var FTP_PASSWORD (despite the name 
it works for all backends)? it's described here
http://duplicity.us/vers8/duplicity.1.html#environment-variables

After making some search on the web, I tried using the IdentifyFile SSH
option, resulting in a different error (BackendException: ssh
connection to Julien@192.168.10.3:22 failed: not a valid EC private key
file ssh: EOF in transport thread), as you can see below.

julien@julien-Latitude-E7440:~$ duplicity -v9
--ssh-options="-oIdentityFile=/home/julien/.ssh/known_hosts"
--allow-source-mismatch --full-if-older-than 1M /bin
sftp://Julien@192.168.10.3/sauvegardes/Nouveau gpg: Attention : les
droits du répertoire personnel « /home/julien/.gnupg » ne sont pas sûrs
Utilisation du répertoire
d’archive : /home/julien/.cache/duplicity/1b9cd978807cebd8b01e39c55cccdeff
Utilisation du nom de sauvegarde : 1b9cd978807cebd8b01e39c55cccdeff Le
binaire GPG est gpg, version 2.2.4 Importation de
duplicity.backends.acdclibackend Succeeded Importation de
duplicity.backends.azurebackend Succeeded Importation de
duplicity.backends.b2backend Succeeded Importation de
duplicity.backends.botobackend Succeeded Importation de
duplicity.backends.cfbackend Succeeded Importation de
duplicity.backends.dpbxbackend Failed: No module named dropbox
Importation de duplicity.backends.gdocsbackend Succeeded Importation de
duplicity.backends.giobackend Succeeded Importation de
duplicity.backends.hsibackend Succeeded Importation de
duplicity.backends.hubicbackend Succeeded Importation de
duplicity.backends.imapbackend Succeeded Importation de
duplicity.backends.lftpbackend Succeeded Importation de
duplicity.backends.localbackend Succeeded Importation de
duplicity.backends.mediafirebackend Succeeded Importation de
duplicity.backends.megabackend Succeeded Importation de
duplicity.backends.multibackend Succeeded Importation de
duplicity.backends.ncftpbackend Succeeded Importation de
duplicity.backends.onedrivebackend Succeeded Importation de
duplicity.backends.par2backend Succeeded Importation de
duplicity.backends.pydrivebackend Succeeded Importation de
duplicity.backends.rsyncbackend Succeeded Importation de
duplicity.backends.ssh_paramiko_backend Succeeded Importation de
duplicity.backends.ssh_pexpect_backend Succeeded Importation de
duplicity.backends.swiftbackend Succeeded Importation de
duplicity.backends.sxbackend Succeeded Importation de
duplicity.backends.tahoebackend Succeeded Importation de
duplicity.backends.webdavbackend Succeeded ssh: starting thread (client
mode): 0x8a4cba10L ssh: Local version/idstring: SSH-2.0-paramiko_2.0.0
ssh: Remote version/idstring: SSH-2.0-OpenSSH_7.4 ssh: Connected
(version 2.0, client OpenSSH_7.4) ssh: kex algos:[u'curve25519-sha256',
u'curve25519-sha256@libssh.org', u'ecdh-sha2-nistp256',
u'ecdh-sha2-nistp384', u'ecdh-sha2-nistp521',
u'diffie-hellman-group-exchange-sha256',
u'diffie-hellman-group16-sha512', u'diffie-hellman-group18-sha512',
u'diffie-hellman-group14-sha256', u'diffie-hellman-group14-sha1']
server key:[u'ssh-rsa', u'rsa-sha2-512', u'rsa-sha2-256',
u'ecdsa-sha2-nistp256', u'ssh-ed25519'] client
encrypt:[u'chacha20-poly1305@openssh.com', u'aes128-ctr',
u'aes192-ctr', u'aes256-ctr', u'aes128-gcm@openssh.com',
u'aes256-gcm@openssh.com'] server
encrypt:[u'chacha20-poly1305@openssh.com', u'aes128-ctr',
u'aes192-ctr', u'aes256-ctr', u'aes128-gcm@openssh.com',
u'aes256-gcm@openssh.com'] client mac:[u'umac-64-etm@openssh.com',
u'umac-128-etm@openssh.com', u'hmac-sha2-256-etm@openssh.com',
u'hmac-sha2-512-etm@openssh.com', u'hmac-sha1-etm@openssh.com',
u'umac-64@openssh.com', u'umac-128@openssh.com', u'hmac-sha2-256',
u'hmac-sha2-512', u'hmac-sha1'] server mac:[u'umac-64-etm@openssh.com',
u'umac-128-etm@openssh.com', u'hmac-sha2-256-etm@openssh.com',
u'hmac-sha2-512-etm@openssh.com', u'hmac-sha1-etm@openssh.com',
u'umac-64@openssh.com', u'umac-128@openssh.com', u'hmac-sha2-256',
u'hmac-sha2-512', u'hmac-sha1'] client compress:[u'none',
u'zlib@openssh.com'] server compress:[u'none', u'zlib@openssh.com']
client lang:[u''] server lang:[u''] kex follows?False ssh: Kex agreed:
diffie-hellman-group-exchange-sha256 ssh: Cipher agreed: aes128-ctr
ssh: MAC agreed: hmac-sha2-256 ssh: Compression agreed: none ssh: Got
server p (8192
bits) /usr/lib/python2.7/dist-packages/paramiko/rsakey.py:119:
DeprecationWarning: signer and verifier have been deprecated. Please
use sign and verify instead. algorithm=hashes.SHA1(), ssh: kex engine
KexGexSHA256 specified hash_algo <built-in function openssl_sha256>
ssh: Switch to new keys ... Utilisation du dossier
temporaire /tmp/duplicity-xbV31b-tempdir Détails de l’erreur de
sauvegarde : Traceback (innermost last): File "/usr/bin/duplicity",
line 1555, in <module> with_tempdir(main) File "/usr/bin/duplicity",
line 1541, in with_tempdir fn() File "/usr/bin/duplicity", line 1380,
in main action = commandline.ProcessCommandLine(sys.argv[1:]) File
"/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1135,
in ProcessCommandLine backup, local_pathname = set_backend(args[0],
args[1]) File
"/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1010,
in set_backend globals.backend = backend.get_backend(bend) File
"/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 223, in
get_backend obj = get_backend_object(url_string) File
"/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 209, in
get_backend_object return factory(pu) File
"/usr/lib/python2.7/dist-packages/duplicity/backends/ssh_paramiko_backend.py",
line 235, in __init__ self.config['port'], e)) BackendException: ssh
connection to Julien@192.168.10.3:22 failed: not a valid EC private key
file

BackendException: ssh connection to Julien@192.168.10.3:22 failed: not
a valid EC private key file ssh: EOF in transport thread

this is *wrong*!
 --ssh-options="-oIdentityFile=/home/julien/.ssh/known_hosts"

the identityfile needs to be a private key and used in case key auth was set up 
beforehand! public key needs to be set up on the target box.

I'm new to making bakups on a NAS and with SFTP. During my searches on
the web to solve my problem, I read different things about
authentication problems with paramiko (I have python-paramiko 2.0.0
installed), SSH and key files or passwords. But it may not apply to my
case.
So, what can I do in order to make my backups work?

if all fails you can try the legacy ssh backend pexpect+sftp:// , some find 
that easier to set up because of some paramiko peculiarities.

also - consider upgrading to maintained, latest duplicity 0.8.x ..good luck 
ede/duply.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]