B
B
bormor2016-10-16 18:05:56
git
bormor, 2016-10-16 18:05:56

Using an OpenSSH key for git. Where is the mistake? What is more correct?

I want to work with git repositories via SSH.
Created a public and private key via OpenSSH.
add private key to ssh agent

[email protected] /C/Users/user/.ssh
$ eval `ssh-agent`
Agent pid 8340

[email protected] /C/Users/user/.ssh
$ ssh-add ~/.ssh/id_rsa

I receive an error message
Error reading response length from authentication socket.
Could not add identity: /c/Users/user/.ssh/id_rsa

Similarly, the bitbucket connection test reports that ssh is not possible:
$ ssh -T [email protected]
Error reading response length from authentication socket.
logged in as dev_web.

You can use git or hg to connect to Bitbucket. Shell access is disabled.

What's my mistake?
How to do ssh-add correctly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Shvets, 2016-10-17
@Xuxicheta

ssh-agent is needed for greater security. In order not to score every time passphrase.
If this is so critical for you, you should at least first understand for yourself the specifics of how ssh works by key and how ssh-agent works regardless of git
. And if you just need to work, you don’t have a large collection of keys to important servers and you need to keep this the developer's machine will not appear, it can be simpler:
Create a key (ssh-keygen), everything is by default, do not enter passphrase.
And then copy the contents of the ~/.ssh/id_rsa.pub file (i.e. your public key) and add it to the service website.

O
om1058, 2016-10-16
@om1058

In the case of services like bitbucket, add your public key through the web interface of bitbucket itself (in the account settings).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question