Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in DevOps and Agile by (19.7k points)

I work at win7 and set up a git server with sshd. I git --bare init myapp.git, and clone ssh://git@localhost/home/git/myapp.git in Cywgin correctly. But I need config git of Cygwinagain, I want to git clone in Git Bash. I run git clone ssh://git@localhost/home/git/myapp.git  and get the following message

ssh_exchange_identification: Connection closed by remote host

 then I run 

 ssh -vvv git@localhost in Git Bash 

and I got this message:

debug2: ssh_connect: needpriv 0

debug1: Connecting to localhost [127.0.0.1] port 22.

debug1: Connection established.

debug1: identity file /c/Users/MoreFreeze/.ssh/identity type -1

debug3: Not a RSA1 key file /c/Users/MoreFreeze/.ssh/id_rsa.

debug2: key_type_from_name: unknown key type '-----BEGIN'

debug3: key_read: missing keytype

debug3: key_read: missing whitespace 

// above it repeats 24 times

debug2: key_type_from_name: unknown key type '-----END'

debug3: key_read: missing keytype

debug1: identity file /c/Users/MoreFreeze/.ssh/id_rsa type 1

debug1: identity file /c/Users/MoreFreeze/.ssh/id_dsa type -1

ssh_exchange_identification: Connection closed by remote host

Does it seem my private keys has wrong format? Though, I found that there are exactly 25 lines in private keys without BEGIN and END. I'm confused why it said NOT RSA1 key, I totally ensure it is RSA 2 key.

Any advice is welcomed.

1 Answer

+2 votes
by (62.9k points)

I have had this problem earlier and I realize that I was connected to 2 different networks (LAN and WLAN), I solved it by disconnecting the cable from my Ethernet adapter. I suppose that the problem was caused because the ssh key was tied with the MAC address of my wireless adapter. I hope this helps you!

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...