美文网首页Git
Git ssh public key

Git ssh public key

作者: JaedenKil | 来源:发表于2019-03-14 14:32 被阅读0次

    Refer to generate ssh public key.

    Sometimes when do a git clone, server may shows an error telling public key not available.

    1. Check ssh public key:
    # User current user directory, for instance /c/Users/xxx/
    cd .ssh
    ls -al # Check if there are files named as `id_dsa` or `id_rsa`. 
    

    If there is one named like id_rsa.pub, then public key is available.

    1. If file not found, then need to generate a key:
    $ ssh-keygen -o
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/schacon/.ssh/id_rsa):
    Created directory '/home/schacon/.ssh'.
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /home/schacon/.ssh/id_rsa.
    Your public key has been saved in /home/schacon/.ssh/id_rsa.pub.
    The key fingerprint is:
    d0:82:24:8e:d7:f1:bb:9b:33:53:96:93:49:da:9b:e3 schacon@mylaptop.local
    
    $ ls
    id_rsa
    id_rsa.pub
    
    1. Can cat id_rsa.pub and copy the content, in the git server settings, add the content to something like SSH Public Keys.
      Refresh the web, then git clone should be okay.

    相关文章

      网友评论

        本文标题:Git ssh public key

        本文链接:https://www.haomeiwen.com/subject/yhwqmqtx.html