C-Duv / sysadmin-scripts

Collection of scripts used for system administration.
GNU General Public License v3.0
9 stars 4 forks source link

duplicityBackup: Could not connect to remote using SSH password #10

Closed C-Duv closed 10 years ago

C-Duv commented 10 years ago

Attempts to backup to a remote SSH storage using login/password fails:

[DEBUG] 2014-10-13 09:35:25 UTC - Duplicity backup will be ran with following command line: [DEBUG] 2014-10-13 09:35:25 UTC - /usr/bin/duplicity incremental --archive-dir "/var/backups/duplicityArchiveDir" --exclude-if-present ".cc_skip_save" --verbosity 8 --f ull-if-older-than 10D --volsize 200 "/root" "ssh://backup-user@server.example.com:22/backups/fs/root" [DEBUG] 2014-10-13 09:35:27 UTC - $actionResult{exitCode} = 23 [DEBUG] 2014-10-13 09:35:27 UTC - $actionResult{stdout} = [DEBUG] 2014-10-13 09:35:27 UTC - Utilisation du répertoire d’archive : /var/backups/duplicityArchiveDir/cca2953bb06fb8cdd072aaad8a4329c4 Utilisation du nom de sauvegarde : cca2953bb06fb8cdd072aaad8a4329c4 Import of duplicity.backends.ftpbackend Succeeded Import of duplicity.backends.tahoebackend Succeeded Import of duplicity.backends.localbackend Succeeded Import of duplicity.backends.botobackend Succeeded Import of duplicity.backends.rsyncbackend Succeeded Import of duplicity.backends.giobackend Succeeded Import of duplicity.backends.hsibackend Succeeded Import of duplicity.backends.ftpsbackend Succeeded Import of duplicity.backends.gdocsbackend Succeeded Import of duplicity.backends.imapbackend Succeeded Import of duplicity.backends.u1backend Succeeded Import of duplicity.backends.sshbackend Succeeded Import of duplicity.backends.webdavbackend Succeeded Import of duplicity.backends.cloudfilesbackend Succeeded Using temporary directory /tmp/duplicity-W8dPac-tempdir Détails de l’erreur de sauvegarde : Traceback (most recent call last): File "/usr/bin/duplicity", line 1404, in with_tempdir(main) File "/usr/bin/duplicity", line 1397, in with_tempdir fn() File "/usr/bin/duplicity", line 1248, in main action = commandline.ProcessCommandLine(sys.argv[1:]) File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1007, in ProcessCommandLine backup, local_pathname = set_backend(args[0], args[1]) File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 900, in set_backend globals.backend = backend.get_backend(bend) File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 158, in get_backend return _backendspu.scheme File "/usr/lib/python2.7/dist-packages/duplicity/backends/sshbackend.py", line 140, in init raise BackendException("ssh connection to %s:%d failed: %s" % (parsed_url.hostname,portnumber,e)) BackendException: ssh connection to server.example.com:22 failed: Authentication failed.

[DEBUG] 2014-10-13 09:35:27 UTC - $actionResult{stderr} = [DEBUG] 2014-10-13 09:35:27 UTC - ssh: Connected (version 2.0, client OpenSSH_6.0p1) ssh: Authentication (publickey) failed. BackendException: ssh connection to server.example.com:22 failed: Authentication failed.

[DEBUG] 2014-10-13 09:35:27 UTC - --- /execDuplicity("incremental", $options, "/root", "ssh://backup-user@server.example.com:22/backups/fs/root") --- [ERROR] 2014-10-13 09:35:27 UTC - An error occurred during backup of "/root" to Storage "secureArchiveNas" (exitcode = 23) [ERROR] 2014-10-13 09:35:27 UTC - STDOUT: Utilisation du répertoire d’archive : /var/backups/duplicityArchiveDir/cca2953bb06fb8cdd072aaad8a4329c4 Utilisation du nom de sauvegarde : cca2953bb06fb8cdd072aaad8a4329c4 Import of duplicity.backends.ftpbackend Succeeded Import of duplicity.backends.tahoebackend Succeeded Import of duplicity.backends.localbackend Succeeded Import of duplicity.backends.botobackend Succeeded Import of duplicity.backends.rsyncbackend Succeeded Import of duplicity.backends.giobackend Succeeded Import of duplicity.backends.hsibackend Succeeded Import of duplicity.backends.ftpsbackend Succeeded Import of duplicity.backends.gdocsbackend Succeeded Import of duplicity.backends.imapbackend Succeeded Import of duplicity.backends.u1backend Succeeded Import of duplicity.backends.sshbackend Succeeded Import of duplicity.backends.webdavbackend Succeeded Import of duplicity.backends.cloudfilesbackend Succeeded Using temporary directory /tmp/duplicity-W8dPac-tempdir Détails de l’erreur de sauvegarde : Traceback (most recent call last): File "/usr/bin/duplicity", line 1404, in with_tempdir(main) File "/usr/bin/duplicity", line 1397, in with_tempdir fn() File "/usr/bin/duplicity", line 1248, in main action = commandline.ProcessCommandLine(sys.argv[1:]) File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1007, in ProcessCommandLine backup, local_pathname = set_backend(args[0], args[1]) File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 900, in set_backend globals.backend = backend.get_backend(bend) File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 158, in get_backend return _backendspu.scheme File "/usr/lib/python2.7/dist-packages/duplicity/backends/sshbackend.py", line 140, in init raise BackendException("ssh connection to %s:%d failed: %s" % (parsed_url.hostname,portnumber,e)) BackendException: ssh connection to server.example.com:22 failed: Authentication failed.

[ERROR] 2014-10-13 09:35:27 UTC - STDERR: ssh: Connected (version 2.0, client OpenSSH_6.0p1) ssh: Authentication (publickey) failed. BackendException: ssh connection to server.example.com:22 failed: Authentication failed.

[DEBUG] 2014-10-13 09:35:27 UTC - --- /executeDuplicityPathBackup("localDisk", "/root", secureArchiveNas, $storage) --- [DEBUG] 2014-10-13 09:35:27 UTC - [Backup:localDisk#/root -> secureArchiveNas] ERROR

According to pexpect backend does not use FTP_PASSWORD without --ssh-askpass flag, the FTP_PASSWORD environment variable is ignored in some cases: maybe this is also the case here.

C-Duv commented 10 years ago

Fixed by merging #11