Mac查看.ssh文件夹的方法

在终端输入命令:$ 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]-----+


©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容