美文网首页
Mac查看.ssh文件夹的方法

Mac查看.ssh文件夹的方法

作者: 摸摸头发 | 来源:发表于2021-08-12 17:46 被阅读0次

    在终端输入命令:$ cd ~/.ssh 查看是否存在ssh文件

    • 存在
    打开终端输入 open ~/.ssh
    cat id_rsa.pub    //打开id_rsa.pub文件,复制密钥
    
    • 不存在
    
    $ ssh-keygen -t rsa -C "邮箱地址"    #邮箱地址为公司的gitlab邮箱,生成KEY
    Generating public/private rsa key pair.
    Enter file in which to save the key (/c/Users/用户/.ssh/id_rsa):    //密钥的目录
    Created directory '/c/Users/用户/.ssh'.
    Enter passphrase (empty for no passphrase):    //密码设置为空
    Enter same passphrase again:
    Your identification has been saved in /c/Users/用户/.ssh/id_rsa.
    Your public key has been saved in /c/Users/用户/.ssh/id_rsa.pub.
    The key fingerprint is:
    SHA256:******* **** //公钥
    The key's randomart image is:
    +---[RSA 3072]----+
    |     o.*+ . .o.. |
    |    + *o*. .. .  |
    |     *.B       o |
    |      +. .    . .|
    |      . S E .  . |
    |     . . + = .o  |
    |    . . + +.*. . |
    |     . o.+o@.    |
    |        o*B.o    |
    +----[SHA256]-----+
    
    
    

    相关文章

      网友评论

          本文标题:Mac查看.ssh文件夹的方法

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