hbons/SparkleShare — Issue #396: Wrong ssh identity
Author: arpie42
Created: 2011-10-30 20:58:07+00:00
State: open

Hello,
I've just installed sparkleshare, created a git repository on my own server, and run into a bunch of problems related to ssh identities. Basically, as far as I can tell, the identity created by sparkleshare in ~/.config/sparkleshare/... is being totally ignored. Instead, any attempt to log in to my server is using my usual users ssh identity in ~/.ssh/.

My installation is basic, having followed the instructions here http://sparkleshare.org/set-up-a-host/ to the letter.

I have circumvented the issue by putting the following line in my /.ssh/ssh_config file :
IdentityFile ~/.config/sparkleshare/sparkleshare.russell.s.palmer@arpie.co.uk.key

which forces any ssh connection attempt to also try the sparkleshare key. As far as I can tell, this has fixed the issue.

BEFORE making this change, this was the behaviour that I was getting :

1) login as user git using standard ssh identity (ie. any ssh ids available to current system user arpie) - fails as you would expect
[arpie@orion ~]$ ssh git@jtd.arpie.co.uk
Permission denied (publickey,gssapi-with-mic).

2) login as user git but specifying sparkleshare identity file - connects correctly, confirming that the correct keys are installed on client and server
[arpie@orion ~]$ ssh git@jtd.arpie.co.uk -i ~/.config/sparkleshare/sparkleshare.russell.s.palmer@arpie.co.uk.key
Last login: Sun Oct 30 21:23:04 2011 from 192.168.0.1
[git@jtd ~]$ exit
logout

3) git clone request fails (as would be expected as it will only use arpie's identity files)
/usr/bin/git clone "ssh://git@jtd.arpie.co.uk/home/git/ArpieSparkle" "/home/arpie/test"
Cloning into /home/arpie/test...
Permission denied (publickey,gssapi-with-mic).
fatal: The remote end hung up unexpectedly

4) Sparkleshare log on clicking 'sync' button in add remote directory dialog:
21:52:10 [Fetcher][/home/arpie/SparkleShare/.tmp/ArpieSparkle] Fetching folder: ssh://git@jtd.arpie.co.uk/home/git/ArpieSparkle
21:52:10 [Fetcher] Disabled host key checking
21:52:10 [Cmd] /usr/bin/git clone "ssh://git@jtd.arpie.co.uk/home/git/ArpieSparkle" "/home/arpie/SparkleShare/.tmp/ArpieSparkle"
Permission denied (publickey,gssapi-with-mic).
fatal: The remote end hung up unexpectedly
21:52:10 [Git] Exit code 128
21:52:10 [Fetcher] Failed
21:52:10 [Fetcher] Enabled host key checking

AFTER making the above change to my /home/arpie/.ssh/ssh_config file, things work perfectly. I won't bore you with command-line output but, basically (refer to 1-4 above):

1) the connection is successful
2) This test is irrelevant, but connection is of course successful
3) the clone is successful
4) The log is as follows:
21:53:38 [Git][ArpieSparkle] Checking for remote changes...
21:53:38 [Cmd] /usr/bin/git ls-remote origin master
Permission denied (publickey,gssapi-with-mic).
fatal: The remote end hung up unexpectedly
21:55:12 [Fetcher][/home/arpie/SparkleShare/.tmp/ArpieSparkle] Fetching folder: ssh://git@jtd.arpie.co.uk/home/git/ArpieSparkle
21:55:12 [Fetcher] Disabled host key checking
21:55:12 [Cmd] /usr/bin/git clone "ssh://git@jtd.arpie.co.uk/home/git/ArpieSparkle" "/home/arpie/SparkleShare/.tmp/ArpieSparkle"
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
21:55:12 [Git] Exit code 0
21:55:12 [Fetcher] Finished
21:55:12 [Fetcher] Enabled host key checking
21:55:12 [Config] Updated "/home/arpie/.config/sparkleshare/config.xml"
21:55:12 [Cmd] /usr/bin/git log -1 --format=%H
21:55:12 [Cmd] /usr/bin/git rev-list --reverse HEAD
21:55:12 [ListenerFactory] Refered to existing listener for irc://204.62.14.135/
21:55:12 [Cmd] /usr/bin/git status --porcelain
21:55:12 [Cmd] /usr/bin/git log -50 --raw -M --date=iso
21:55:12 [Cmd] /usr/bin/git log -50 --raw -M --date=iso
21:55:12 [Cmd] /usr/bin/git status --porcelain

All is well... for now.

Any thoughts from those who understand this better than me would be much appreciated.