github - How to configure git's ssh key?
迷茫
迷茫 2017-05-02 09:46:37
0
1
629

I used ssh-keygen -t rsa -C "humingx@yeah.net" to generate a secret key in one of my git repositories. I was prompted to enter a name, and then I entered y, so two files y.pub and y appeared in this directory, but /Users Two files id_rsa id_rsa.pub also appear in the /username/.ssh directory, and the public key in id_rsa.pub is different from the public key in y.pub.
What I want to ask is:

  1. Does the ssh key of git correspond to a code repository?

  2. Why are the contents of the y.pub and id_rsa.pub files different? Which one should I fill in when I submit the ssh key in the remote code repository?

Please everyone

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
巴扎黑

y and y.pub should have been generated at unknown times before. You will know by looking at the file modification time. The correct generation path is in the .ssh directory. Because your command does not specify a path or name, id_rsa is the default name.
An ssh key pair can correspond to a github account or a project. If you want all projects your account participates in to use this key, configure it in the account settings. If you only want to use it for a certain project, configure it in the project settings.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template