Ticket #43 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

ssh key detection doesn't work

Reported by: jhb Assigned to: Andy
Priority: normal Milestone: Stable
Component: backend Version:
Severity: normal Keywords:
Cc:

Description

pybackpack doesn't detect SSH keys correctly. It should use ssh-add to determine if they are loaded in a running ssh-agent process, no? I have no idea how the current method is supposed to work.

Change History

16/02/07 17:35:37 changed by Andy

Hi, thanks for your bug report. I'm unsure about what the bug is exactly. Could you expand on it? Is there some sequence of actions I could carry out to expose the bug? Thanks.

17/02/07 20:01:26 changed by jhb

The bug is that I have ssh keys added to an existing ssh-agent process by using a keychain script (from http://www.gentoo.org/proj/en/keychain/), so any ssh-related process can use them. rdiff-backup uses them without a problem, but pybackpack has a test SSHKeysDetect (rdiff_interface.py line 58) that fails:

58 def SSHKeysDetect(user, host):
59 """Determines if SSH keys are setup for the remote host specified"""
60 try:
61 gnomevfs.open_directory("sftp://%s@%s" % (user, host))
62 except:
63 return False
64 return True

I don't know why, because I know nothing about python or gnomevfs. The way I know to check if SSH keys are loaded is the command "ssh-add -l", but that might just work for my way of doing things, and not whatever way you're checking. Maybe the best thing to do is have rdiff-backup see if it can run a --server process on the remote machine?

Just FYI, I'm using pybackpack on OS X 10.4 and ubuntu dapper - each of which required some fiddling with the pybackpack code.

18/02/07 21:55:08 changed by jhb

rdiff-backup --test-server remote_host::filename

--test-server

Test for the presence of a compatible rdiff-backup server as specified in the following host::filename argument(s). The filename section will be ignored.

12/03/07 02:51:52 changed by Andy

  • status changed from new to assigned.

Sorry for the long delay, I've been quite busy lately. It does seem that rdiff-backup pops up its own ssh-askpass dialog box to ask for a key passphrase or password (but only when pybackpack isn't run from a terminal). I'll strip out the SSHKeysDetect() function tomorrow. Thanks!

12/03/07 09:20:26 changed by Andy

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in [64]

14/03/07 21:38:41 changed by jhb

Great, thanks. Honestly, I've hacked a number of fixes to the pybackpack scripts for OS X (let me know if you're interested in the details), so I probably won't update until new functionality is available, like partial restores or compatibility with generic rdiff-backup backups (hint, hint).

18/03/07 23:07:48 changed by Andy

Well I don't have a box with OS X on it myself but I'm still curious about your fixes. Maybe others could benefit from them. Feel free to attach diffs to this bug or e-mail me (andy [at] andrewprice.me.uk). Cheers.