search

Home  >  Q&A  >  body text

git - After ssh-keygen, the generated passwords are called id_rsa.pub. Can I change the name?

After ssh-keygen, the generated passwords are called id_rsa.pub. Can I change the name?

过去多啦不再A梦过去多啦不再A梦2793 days ago935

reply all(4)I'll reply

  • 大家讲道理

    大家讲道理2017-05-02 09:36:06

    The generated one is the public key id_rsa.pub and the private key id_rsa
    You can use ssh-keygen -f othername to generate the specified file name, or you can rename both after generation

    But the ssh command will only read the private key id_rsa by default, so if it is another name, you need to add the configuration file ~/.ssh/config
    For example, the following is the configuration of the key I generated specifically for github

    Host github.com gist.github.com api.github.com
    IdentityFile /path/to/othername

    reply
    0
  • 为情所困

    为情所困2017-05-02 09:36:06

    That’s not a password,,, that’s just the name of a secret key file. You will never look at it again. Why do you care about it?

    reply
    0
  • 黄舟

    黄舟2017-05-02 09:36:06

    id_rsa is the private key, id_rsa.pub is the public key
    The key is to look at the content inside, just make sure you are happy with the name

    reply
    0
  • PHPz

    PHPz2017-05-02 09:36:06

    ssh-keygen -t rsa -f ~/.ssh/你开心就好

    will be in ~/.ssh/目录下生成你开心就好的私钥和你开心就好.pub’s public key.

    reply
    0
  • Cancelreply