Advertisement

建立GitHub SSH代理

阅读量:

1. 本地生成公私钥

在Linux操作系统中,系统默认将ssh密钥相关的文件存储于用户主目录下的隐藏文件夹~/.ssh之中。

复制代码
    ssh-keygen -t rsa -C "chgl16"
    
    
      
    

-t 参数用于指定秘钥类型,其默认值为 rsa
-C 参数用于添加秘钥注释

执行完成后,能够在 ~/.ssh 文件夹中查看到生成的公钥与私钥

复制代码
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/chgl16/.ssh/id_rsa): /home/chgl16/.ssh/id_rsa
    Created directory '/home/chgl16/.ssh'.
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /home/chgl16/.ssh/id_rsa.
    Your public key has been saved in /h

全部评论 (0)

还没有任何评论哟~