ssh-options not passed in 'rsync over ssh'

Bug #822697 reported by hovis
60
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned
CentOS
New
Undecided
Unassigned
Debian
New
Undecided
Unassigned

Bug Description

Given some ssh-options, they do not seem to be passed to ssh when using 'rsync over ssh':-

duplicity -v9 --ssh-options="-oIdentityFile=my_rsa" list-current-files rsync://backup@192.168.40.11/backups/test

The -oIdentityFile option is not passed to ssh.

Duplicity: 0.6.14
Python: 2.7.2
OSX 10.6.8

$ duplicity -v9 --ssh-options="-oIdentityFile=my_rsa" list-current-files rsync://backup@192.168.40.11/backups/test
Using archive dir: /Users/richard/.cache/duplicity/e6bb11a1935403d725321394800adb89
Using backup name: e6bb11a1935403d725321394800adb89
Import of duplicity.backends.botobackend Succeeded
Import of duplicity.backends.cloudfilesbackend Succeeded
Import of duplicity.backends.ftpbackend Succeeded
Import of duplicity.backends.ftpsbackend Succeeded
Import of duplicity.backends.giobackend Failed: No module named gio
Import of duplicity.backends.hsibackend Succeeded
Import of duplicity.backends.imapbackend Succeeded
Import of duplicity.backends.localbackend Succeeded
Import of duplicity.backends.rsyncbackend Succeeded
Import of duplicity.backends.sshbackend Succeeded
Import of duplicity.backends.tahoebackend Succeeded
Import of duplicity.backends.u1backend Succeeded
Import of duplicity.backends.webdavbackend Succeeded
Main action: list-current
================================================================================
duplicity 0.6.14 (June 18, 2011)
Args: /opt/local/bin/duplicity -v9 --ssh-options=-oIdentityFile=my_rsa list-current-files rsync://backup@192.168.40.11/backups/test
Darwin mumble.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386 i386
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python 2.7.2 (default, Jun 25 2011, 14:26:40)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
================================================================================
Reading results of 'rsync -e 'ssh -oBatchMode=yes' backup@192.168.40.11:backups/test/'
Running 'rsync -e 'ssh -oBatchMode=yes' backup@192.168.40.11:backups/test/' failed with code 255 (attempt #1)
Error is:
Permission denied (publickey,password).
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(601) [Receiver=3.0.8]

Tags: ssh-options
Revision history for this message
Jeroen Versteeg (mail-jayvee) wrote :

I have this problem on Debian GNU/Linux testing (wheezy) with duplicity 0.6.18 (February 29, 2012)

Revision history for this message
Lluis Gili Belmonte (tictacbum) wrote :

This is still an issue on version 0.6.20

Revision history for this message
carloslp (carloslp) wrote :

I confirm this bug.

However I found a way of workaround it.

$ duplicity --verbosity 9 --exclude-other-filesystems --exclude-device-files --encrypt-sign-key 123664B6 --rsync-options "--bwlimit=500 --rsh=\"ssh -oBatchMode=yes -p 22 -i "/etc/cron.duplicity/duplicity_key"\" /home rsync://user@host:22//backup/home

================================================================================
duplicity 0.6.18 (February 29, 2012)
Args: /usr/bin/duplicity --verbosity 9 --exclude-other-filesystems --exclude-device-files --encrypt-sign-key 123664B6 --rsync-options --bwlimit=500 --rsh="ssh -oBatchMode=yes -p 22 -i /etc/cron.duplicity/duplicity_key" /home rsync://user@host:22//backup/home
================================================================================

Calling duplicity with --rsync-options and passing --rsh or -e as rsync option you can overwrite the default "-e" and include inside the call the path to the key.

Revision history for this message
Laszlo Ersek (lacos-caesar) wrote :

Another workaround should be creating a new Host entry in the ssh config file (with a made-up name). All ssh options could be specified there. The HostName option would supply the real host name to log into.

duplicity -v9 list-current-files rsync://backup-host/backups/test

Host backup-host
    User backup
    HostName 192.168.40.11
    IdentityFile my_rsa

Revision history for this message
Christoph Löhr (chrit) wrote :

duplicity 0.7.07.1 (April 19, 2016)
Args: /usr/bin/duplicity full --encrypt-key xxxx --rsync-options="-oIdentityFile=/home/$user/.ssh/xxxxxxx.ke" --progress --volsize 1024 --exclude=/proc --exclude=/sys --exclude=/dev --exclude=/proc --exclude=/sys --exclude=/mnt --exclude=/media --exclude=/tmp --exclude=/var/spool --exclude=/var/cache --exclude=/var/tmp / rsync://$user@$host//data/backup/$client -v info
Linux $client 2.6.32-573.18.1.el6.x86_64 #1 SMP Tue Feb 9 22:46:17 UTC 2016 x86_64 x86_64
/usr/bin/python2 2.6.6 (r266:84292, Jul 23 2015, 15:22:56)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)]

Reading results of 'rsync -e 'ssh -oBatchMode=yes' -oIdentityFile=/root/.ssh/xxxxxxx.key $user@$host:/data/backup/snozzle/'
Attempt 1 failed. BackendException: Error running 'rsync -e 'ssh -oBatchMode=yes' -oIdentityFile=/root/.ssh/duplicity_snozzle.key $user@$host:/data/backup/snozzle/': returned 14,

The Issue is:
--rsync-options="-oIdentityFile=/home/$user/.ssh/xxxxxxx.key"

the built rsync options are:
'rsync -e 'ssh -oBatchMode=yes' -oIdentityFile=/root/.ssh/xxxxxxx.key $user@$host//data/backup/$client'

He're the -oIdentityFile= is not included to the rsync -e '..' command, so it will not be interpreted the correct way by rsync. If you use a -i lalala.key the issue persits.

Revision history for this message
Christoph Löhr (chrit) wrote :

This is still an issue on version 0.7.07.1

Changed in duplicity:
assignee: nobody → Kenneth Loafman (kenneth-loafman)
importance: Undecided → Medium
milestone: none → 0.7.08
status: New → In Progress
Changed in duplicity:
assignee: Kenneth Loafman (kenneth-loafman) → nobody
status: In Progress → Fix Committed
Changed in duplicity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.