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:
Does the ssh key of git correspond to a code repository?
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
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.