A
A
Apostol632021-04-28 12:43:25
git
Apostol63, 2021-04-28 12:43:25

Why does git clone throw a Permission denied (publickey) error?

Good day to all.

The problem is the following. When trying to clone a remote repository, a Permission denied (publickey) error is thrown.

I generated the keys on ubuntu, and now I need to work from Windows. I copied these same keys and placed them in the .ssh folder available on Windows. Namely, in id_rsa and id_rsa.pub. But the error is still thrown.

I wanted to generate new keys, but I was told to use the existing ones.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Apostol63, 2021-04-28
@Apostol63

If suddenly someone encounters a similar problem, then I solved it as follows
in the .ssh folder, created a config file (without extension) and added the following there:
host (specify host)
hostname (specify hostname)
port (specify the required port)
user (specify user )
identityfile ~/.ssh/id_rsa

D
Denis Zagaevsky, 2021-04-28
@zagayevskiy

On unix-like systems, you would need to ssh-add to add the private key.
Windows has its own instructions .

N
netrox, 2021-04-28
@netrox

I wanted to generate new keys, but I was told to use the existing ones.

Like this ?
Just create new keys and bind the new public key to your git account.
https://phoenixnap.com/kb/generate-ssh-key-windows-10
https://docs.github.com/en/github/authenticating-t...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question