Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

can't fetch host key #1098

Closed
MartinL0815 opened this Issue · 20 comments

3 participants

@MartinL0815

I'm completely new to github and to ssh, but the ssh URL github provides for read and write access to my newly created project is slightly different to the one "compiled" by SparkleShare:

git@github.com:MartinLemburg/WebPageProject.git

The "compiled" one:

git@github.com/MartinLemburg/WebPageProject.git

Since this delimeter between server and the path is not part of the plugin XML configuration it perhaps doesn't cause the problem SparkleShare has, right?

@MartinL0815

I'm behind a company firewall.

Could it be, that the firewall blocks the ssh port needed to access any github projects?

@MartinL0815

Aehm, GitHub for Windows works. But I even don't know if it uses ssh to access my project.

@hbons
Owner

the notation with the ":" is some kind of alias used to make urls shorter. SparkleShare doesn't support this though, so you'll want to use the "longer" notation (in this case, it's not even longer).

@hbons
Owner

it could be that the Github client uses http, instead of ssh. you can double check your company's firewall policy.
was there any other message SparkleShare gave you? if not, maybe you can post some parts of the log (about dialog) here. it may give use some clues.

@MartinL0815

The debug log tells …

12:43:29 | Controller | ssh-agent started, PID=6940
12:43:30 | Auth | Imported key 'C:\Users\lemburg\AppData\Roaming\sparkleshare\2012-12-11 11h07.key'
12:43:30 | Auth | The following keys may be used:
…
12:59:42 | Fetcher | C:\Users\lemburg\SparkleShare\.tmp\WebPageProject.git | Fetching folder: ssh://git@github.com/MartinLemburg/WebPageProject.git
12:59:42 | Auth | Fetching host key for github.com
12:59:42 | Cmd | ssh-keyscan -t rsa -p 22 github.com
12:59:52 | Auth | Could not fetch host key

I deleted the key values for publishing here.

Perhaps the next to lern … do I have to enter a key into the web sided github configuration called "SSH Keys" (https://github.com/settings/ssh)?
And what means, that the host key couldn't be fetched?

@MartinL0815

BTW where do I get the "long" ssh URL from?

Or did I misunderstand you, so that the "long" ssh URL is in my case not longer than "short" ssh URL and that there is only the colon is replaced by a slash?

@hbons
Owner

yes, you have to upload your key (or "link code") to github.

@hbons
Owner

you are right on the url format. just avoid using the one with the colon. so are you trying to create a plugin now or is it the Add dialog that fails now when you enter the values manually?

@hbons
Owner

what do you get if you run ssh-keyscan -t rsa -p 22 github.com from a command line?

@MartinL0815

Okay, I've added manually the contents of the public SparkleShare key file to the ssh settings.
Or how do I "link code"?

@MartinL0815

Since I'm on Windows?

c:\windows\system32>ssh-keyscan -t rsa -p 22 github.com
'ssh-keyscan' is not recognized as an internal or external command, operable program or batch file.
@hbons
Owner

that's it. but i think this problem is caused by something else.

@hbons
Owner

can you try to run it from the directory where SparkleShare keeps its git and ssh binaries? it think it's C:\Program Files\SparkleShare\msysgit or similar.

@megamorf

C:\Program Files (x86)\SparkleShare\msysgit\bin> .\ssh-keyscan.exe -t rsa -p 22 github.com

There you go, just trying to get github running as well.

@MartinL0815

So back at the computer … executed ssh-keyscan.exe in your proposed directory and got ... no error message:

c:\Program Files (x86)\SparkleShare\msysgit\bin>ssh-keyscan -t rsa -p 22 github.com

c:\Program Files (x86)\SparkleShare\msysgit\bin>

What should have had happen?

I retried again to add a hosted project with:

  • github plugin
  • the path /MartinLemburg/WebPageProject.git

Again it failed.

The debug log entries are:

09:27:18 | Fetcher | C:\Users\lemburg\SparkleShare\.tmp\WebPageProject.git | Fetching folder: ssh://git@github.com/MartinLemburg/WebPageProject.git
09:27:18 | Auth | Fetching host key for github.com
09:27:18 | Cmd | ssh-keyscan -t rsa -p 22 github.com
09:27:26 | Auth | Could not fetch host key
@hbons
Owner

the command should have given you github's host key. why this doesn't happen, i don't know...

@megamorf

I got it to work. open %appdata%\Sparkleshare and open the public key file with a text editor. You then paste the code in the SSH keys section on github and confrm with your github password. Then you enter /username/repositorynamewithoutdotgit in the corresponding text box. Sync the repo and you're done.

@hbons
Owner

@MartinLemburg you did upload sparkleshare's public key or link code to github?

@megamorf

The link code that you can copy to your clipboard during the sparkleshare setup can be found in "C:\Users\%username%\AppData\Roaming\sparkleshare\timestamp.key.pub". You should upload that. @hbons is that correct?

@hbons
Owner

@megamorf yes, but it's also in ~/SparkleShare for easier access.

@hbons hbons closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.