S
S
Sergey Burduzha2017-09-19 17:24:13
SSH
Sergey Burduzha, 2017-09-19 17:24:13

How to enable ssh key for github?

In the .ssh/ folder, I generated two files
ssh-keygen -t rsa
I set the name git_rsa, as a result, two files appeared git_rsa and git_rsa.pub
In the .ssh folder, I created a config file, wrote it there

Host github.com
 IdentityFile ~/.ssh/git_rsa

for github to identify the key
On github in my account I created an ssh key and put the contents of the git_rsa.pub file in it
. I have a small project on the machine, I created a new repository on github and immediately want to import my project in it.
On the machine, I initialized git in the git init site folder and after that I want to export the contents to github
before, of course, on the machine git --all, git commit "first commit"
git remote add origin https://github.com/seriiserii825/test.site.git

So here's my question: when submitting to github, it asks for an account address and password, but how do I force it to use the ssh key that I created.
I found the answer that the key is used when cloning from github, but in my case, it will not work, that is, do I need to clone?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2017-09-19
@serii81

change url from http to git.
git when copying itself suggests: you for ssx or http.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question