Keirathi
Keirathi

Reputation: 397

Configuring SSH for git

I posted about this yesterday, but I've made a bit of headway. Turns out my IP address got blacklisted by the server. I'm still having some trouble though.

When I run "ssh -vvv [email protected]", I get back this:

debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /.ssh/id_rsa
debug3: no such identity: /.ssh/id_rsa: No such file or directory
debug1: Trying private key: /.ssh/id_dsa
debug3: no such identity: /.ssh/id_dsa: No such file or directory
debug1: Trying private key: /.ssh/id_ecdsa
debug3: no such identity: /.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /.ssh/id_ed25519
debug3: no such identity: /.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive

(That's just a snippet that seems to be the root of the problem. The entire log is here: http://pastebin.com/Ryx4NFwW )

It's saying that /.ssh/id_rsa doesn't exist, but:

PS C:\Users\Jonathan\.ssh> ls


    Directory: C:\Users\Jonathan\.ssh


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---         9/10/2014  10:58 PM         67 config
-a---          7/5/2014  10:39 PM       1675 github_rsa
-a---          7/5/2014  10:39 PM        402 github_rsa.pub
-a---         9/10/2014  11:14 PM       1679 id_rsa
-a---         9/10/2014  11:14 PM        397 id_rsa.pub
-a---         9/10/2014  10:17 PM        193 known_hosts

Anyone have any ideas?

Edit: I should note that if I do "ssh -vvv -i C:\Users\Jonathan.ssh\id_rsa [email protected]" it seems to work correctly.

Edit2: I just noticed something even stranger. In the full log I posted up above, there's this section:

debug3: load_hostkeys: loading entries for host "gitlab.cs.myschool.edu" from file "/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "137.30.120.92" from file "/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'gitlab.cs.uno.edu' is known and matches the ECDSA host key.
debug1: Found key in /.ssh/known_hosts:1
debug1: ssh_ecdsa_verify: signature correct

It can find and read from the known_hosts file. Which is in the same directory as my id_rsa key file. This is really confusing and not making any sense :(

Edit 3: I also tried making a config file at C:\Users\Jonathan.ssh\config (there wasn't one there before) and put this in it:

Host gitlab.cs.uno.edu
    IdentityFile C:\Users\Jonathan\.ssh\id_rsa

Also tried changing the host to just uno.edu, but still no go. Keep getting access denied when I try to run git clone.

Upvotes: 1

Views: 2952

Answers (1)

VonC
VonC

Reputation: 1323653

You need to make sure of your %HOME% environment variable value: since the openssh packaged with git will search for the ssh keys in %HOME%/.ssh/, that would explain the /.ssh/ that you see if %HOME% was empty.

The git-cmd.bat is supposed to set %HOME% properly.

Upvotes: 3

Related Questions