git and public key

Support for running, installing or compiling OpenMW
Locked
User avatar
lgromanowski
Site Admin
Posts: 1193
Joined: 05 Aug 2011, 22:21
Location: Wroclaw, Poland
Contact:

git and public key

Post by lgromanowski »

Star-Demon wrote: So, following the wiki FAQ I registered, and then following it still I attempted to clone, and...

Code: Select all

The authenticity of host 'github.com (207.97.227.239)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts ("C/.ssh/known_hosts).
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
So what do I do?
Zini wrote: You did register your public key with github, right? Can't think of any other problem.
Star-Demon wrote:
Zini wrote:You did register your public key with github, right? Can't think of any other problem.
My...public key? What public key?
Okay. Obviously there's a big step I missed in this.

EDIT: I...see...
http://help.github.com/msysgit-key-setup/
Lemme give this a shot, I'll add it to the wiki after.
EDIT2: Nope. there's something wrong with SSH, I made a key and it doesn't work
Star-Demon wrote: Yeah, I've been looking over those.

I noticed it didn't save my key to the place it said it did. It's in my user folder on windows 7. I tried doing it from the C directory but now it's someplace deep in appdata.

For whatever reason, I can't find a c:\.ssh directory. (hide hidden is off) I don't know. For whatever reason, won't find it.

EDIT: Tried it by installing again, got a MING32 window that looked way prettier and had colors and the prompt looked like it should. yay? I've been using the wrong program? Why does it say MINGW32? I hate that thing, What was the difference? Crud.

Made a new key, and this time I got farther, buuut...my key ended up in msysgit, and the .ssh folder under users doesn't contain identity, rsa and dsa files...

EDIT: Reinstall a different git exe, looks way better, but still don't see /.ssh/id_rsa
/.ssh/id_dsa

Really getting frustrated.
athile wrote: Star-Demon: have you tried using cygwin? I've been using cygwin for all git operations on Windows (but still CMake from a standard cmd.exe prompt and Visual Studio for compiling) and haven't ran into any real problems.

On the other hand, I could never get msys-git working.
nicolay wrote: Ok, I assume you have run ssh-keygen as the above link instructs? In the output from ssh-keygen it should tell you where it stored the keys. These need to be stored in .ssh/ in the home directory - which is typically not C:\ but typically something like \Users\Yourname\.ssh. Is the problem that you can't find the generated keys, or that ssh/git doesn't find them? Or am I misunderstanding what the problem is?

BTW: You can check the location of the home directory with

Code: Select all

echo $HOME
Star-Demon wrote: Well, among other things the verbose test will say, or when I attempt to clone, is that it jumps through finding identity, id_rsa, and id_dsa files, and then gives the fail public key message.

now, my .ssh folder in the windows user directory shows only three files:
my key
my key.pub
known_hosts

From what the help file says, there should be more there, and there isn't.

What's odd is that I have another SSH console application that I use for school, I didn't have this much setup.

Oh my god, I can't copy and paste commands or text from the output window? seriously? I really hate coding in the stone age. Sorry. Lemme drink this coffee...

....ahhh...

okay...git says that github is a known host, which is good as it's reading from known_hosts, which is in that user folder in windows.
then it goes through the three files as a private key(debug saying the line I gave but with -1, -1, -1 as output at the end, probably saying not found), then denies me due to public key.

Well, at the minimum, I'm registered on github, and I can see 9 other folks on the team, as well as the merging and branch chart, which is cool. hopefully I'll have a line of my own, soon, but I imagine at my level I'll have to wait until some more stuff is done and then start making some small things. I can keep busy, though.
Star-Demon wrote:
nicolay wrote:Ok, I assume you have run ssh-keygen as the above link instructs? In the output from ssh-keygen it should tell you where it stored the keys. These need to be stored in .ssh/ in the home directory - which is typically not C:\ but typically something like \Users\Yourname\.ssh. Is the problem that you can't find the generated keys, or that ssh/git doesn't find them? Or am I misunderstanding what the problem is?
Home location looks good.

Well, it seems to be able to find the keys because it can find the known hosts. They are in the same directory. The problem is these nonexistent other files...I'll have to google what they are and what function they serve.
nicolay wrote: The files "my key" and "my key.pub" look strange to me - were these generated by ssh-keygen? Is it possible that you simply need to rename (or copy) them to id_dsa/id_dsa.pub (or id_rsa or whatever it's supposed to be) in the same directory?
Star-Demon wrote:
nicolay wrote:The files "my key" and "my key.pub" look strange to me - were these generated by ssh-keygen? Is it possible that you simply need to rename (or copy) them to id_dsa/id_dsa.pub (or id_rsa or whatever it's supposed to be) in the same directory?
Yup - when you type in "ssh keygen -t rsa -C "blahblah", it does some stuff, then asks you to type in a file name. After that, it creates two files, a file containing a very verbose version of the key, and a file of hte same name with a .pub extension, which contains the actual text you paste into github's key field. These are the only files in the /.ssh directory other than known_hosts, which had github placed into it when I attempted to ssh in and failed. It checks it now, but the other three items are simply not there. We'll have to find out what they are.
nicolay wrote: Ok. Then those are likely the files you are looking for, just by the wrong name. IIRC the only thing ssh needs (and it's ssh we're messing with here, git lets ssh handle all the networking and doesn't really know anything about this key stuff), is to find a private key in .ssh/id_rsa that matches the public key on the remote end. Assuming you've already given the contents of "my key.pub" to github (which of course is the remote end), all you need to do is to rename your 'my key' file to id_rsa.

I.e.,

Code: Select all

cd .ssh
mv "my key" id_rsa
Star-Demon wrote: Okay, but that item doesn't exist...is that a folder or an actual file? Do I need to make that directory?

(using linux command or windows command version of makedir/mkdir?)
nicolay wrote: What item doesn't exist? You just said you had an .ssh directory with a file named "my key" in it? That's all I'm refering to here.
Star-Demon wrote:
nicolay wrote:What item doesn't exist? You just said you had an .ssh directory with a file named "my key" in it? That's all I'm refering to here.
id_rsa and id_dsa...you said I should just rename the key to one of those?
nicolay wrote: Yes. You'll only need one of them, id_rsa. (It's rsa or dsa depending on what encryption algorithm generated the key. Judging from the ssh_keygen command you wrote it is an rsa key.) You should rename the key file ("my key") to id_rsa (using the mv command I mentioned above, or you can do it in windows explorer if you like).

I think ssh_keygen creates the file by that name (id_rsa or id_dsa) by default, but I'm guessing you wrote the name "my key" when it asked for a filename, thus overriding the default. IIRC if you just press enter when it asks, then it uses the default name.

EDIT: oh one more basic detail, since I just realized you might not be used to unix commands: the 'mv' command (move) is also the command you use to simply rename files (or directories). So "mv abc def" renames the file "abc" to "def".
Star-Demon wrote: I log into unix for school, so I know a bit. Thanks. Lemme try that, then.


Edit: Perfect. You just rename the un-extensioned key file into id_rsa and it goe as the troubleshooting guide says. I'll add that in to the wiki soon.

btw: No copy and paste of commands or console? LAME! :P
Star-Demon wrote: had some trouble with

# Add the master branch to your local machine using the public URL on the official fork: in the openmw directory, git remote add upstream http://github.com/korslund/openmw.git

but I navigated to openmw and did it again, didn't output anything but it took.

Seems I'm in business. Now - how to set up the C++ project for VS2010?
Star-Demon wrote: Well, cloned my source...can't Cmake it...wonder if I forgot something. it complained about CMAKE_INSTALL_PREFIX on a Program files x32 folder.

At any rate, I'm kinda at my limits for figuring out what to do next. How am I loading this into VC and working with it? How do I properly use Cmake?

There's a lot missing from the wiki on getting started. I'd write it myself, but I really do not have a lot of success configuring these environments - not a lot of experience doing a project like this.

Well, At least I can always alter my own source in the folder, then use a git command to push it, right?
nicolay wrote: Great that you got git working at least :)
Star-Demon wrote:Well, At least I can always alter my own source in the folder, then use a git command to push it, right?
That's right. BTW there are reputedly several GUI alternatives to the command line for Windows (as well as for Linux, never tried any myself), but in any case it's probably best to learn the basic commands first so one gets a hang of how things work.

I can't be much help with Windows compiling and setup unfortunately. This is definitely one area where we need more info in the wiki.
Star-Demon wrote: Don't worry about it, I'm a fan of OpenSuse, myself, but I definitely am on the windows side of things. I'm sure we'll get something cooked up for future use.

Not really the command line I worry about - it's the ease and integration of things. In school you're taught to code in bash..or even less than bash, but would you rather walk to work or use a car? Or fly? Or teleport? :)

And so - that's the story of how I dropped SDL and switched to XNA! hahaha!
Locked