hbons / SparkleShare

Share and collaborate by syncing with any Git repository instantly. Linux, macOS, and Windows.
https://sparkleshare.org
Other
4.87k stars 579 forks source link

"Could not import key" in Win7 64-bit #1037

Closed pcdahle closed 10 years ago

pcdahle commented 11 years ago

I'm trying to setup Sparkleshare on Win7 64-bit (it went smoothly on my MacBookPro) I'm using 0.9.5 (as 0.9.6 link does not seem to work, see other issue)

When adding the project, it doesn't work as the server doesn't accept the public key. It seems as the public key isn't even loaded

17:55:52 | Controller | ssh-agent started, PID=1328 17:55:52 | Config | Wrote to 'C:\Users\pald\AppData\Roaming\sparkleshare\config.xml' 17:55:52 | Config | Updated option notifications:True 17:55:53 | Auth | Created keypair 'C:\Users\pald\AppData\Roaming\sparkleshare\2012-10-28 17h55.key' 17:56:03 | Auth | Could not import key 'C:\Users\pald\AppData\Roaming\sparkleshare\2012-10-28 17h55.key'

I have read other issues about this but can't seem to get a straight answer on a fix really.

hbons commented 11 years ago

so what was the issue?

oli-ver commented 11 years ago

Hello together,

to add something to the discussion... I had the problem that on Win7 64-bit the process to add a new hosted project just hang in the first step. The .tmp-folder did not "grow" or something, so I suggested a problem before actually getting on the server. Trying to connect via ssh resulted in being asked for my password, so I believed there had not been a key transfer yet.

When adding the project via the SparkleShare GUI I hoped that I would perhaps be asked for a user password, but in the forums and wiki here I found hints how this worked on Unix-based systems. So I tried the following with the original installation of SparkleShare.

After that I could login to the server without using my password, so I suggested this would be enough.

But because SparkleShare generated a keypair named by a timestamp in the folder "%appdata%\sparkleshare" on my windows client I suggested it uses this pair for authenticating and this did not work. So I moved the files to a backup folder, copied my id_rsa.pub and id_rsa to this destination and restarted SparkleShare.

This worked! Perhaps someone can try this, too.

I hope my post helped some of you.

Regards,

Oliver

andredasilvapinto commented 11 years ago

@hbons I don't know. maybe jasotmp's firewall...

jasewells commented 11 years ago

I have a user where the original problem is happening — when he tries to checkout the project, the SparkleShare progress bar just stays at the beginning mark and nothing happens. In the log, I see this: (user name and remote server have been obscured)

13:18:12 | Controller | ssh-agent started, PID=5772 13:18:12 | Config | Wrote to 'C:\Users\Joe User\AppData\Roaming\sparkleshare\config.xml' 13:18:12 | Config | Updated option notifications:True 13:18:17 | Auth | Created keypair 'C:\Users\Joe User\AppData\Roaming\sparkleshare\2013-05-15 13h18.key' 13:18:27 | Config | Wrote to 'C:\Users\Joe User\AppData\Roaming\sparkleshare\config.xml' 13:18:28 | Auth | Could not import key 'C:\Users\Joe User\AppData\Roaming\sparkleshare\2013-05-15 13h18.key' 13:20:14 | Fetcher | C:\Users\Joe User\SparkleShare.tmp\MCF01 | Fetching folder: ssh://storage@---.com/MCF01 13:20:14 | Auth | Fetching host key for ---.com 13:20:14 | Cmd | ssh-keyscan -t rsa -p 22 ---.com 13:20:16 | Auth | Skipping fingerprint check 13:20:16 | Cmd | .tmp | git clone --progress --no-checkout --depth=1 "ssh://storage@---.com/MCF01" "C:\Users\Joe User\SparkleShare.tmp\MCF01" 13:20:20 | Fetcher | Failed to dispose properly: No process is associated with this object. at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.Kill() at SparkleLib.Git.SparkleFetcher.Stop() 13:20:21 | Controller | Deleted C:\Users\Joe User\SparkleShare.tmp\MCF01

So it looks like the key pair gets created (and indeed they are in the sparkleshare folder with the log file) but the key file does not get loaded into ssh-agent. I will try to run ssh-agent and ssh-add manually on his machine to see if there is any output from ssh-add.

Note: This is with the 1.0.0 release. (Maybe the log file should include the version?) This particular user is NOT on our Active Directory domain. But I've tried it on fresh installs of Win7 and it works for me, whether it's a machine on the domain or not.

hbons commented 10 years ago

anyone who can try 1.2 and see if this still happens?

hbons commented 10 years ago

let me know if this still happens with a fresh 1.2 install, as some things have changed in the way keys are handled. i'm closing this meanwhile.