当前位置:网站首页>创建 SSH 秘钥对 配置步骤
创建 SSH 秘钥对 配置步骤
2022-06-26 05:05:00 【浅墨cgz】
创建 SSH 秘钥对
作用
创建的 SSH 秘钥对,用于 GitLab 仓库拉取代码,以及测试服务器的登录认证。
检查秘钥对是否存在
在生成 SSH 密钥之前,可以先检查,是否已经存在 SSH 密钥。下面提供两种方式:
- 终端输入
ls -al ~/.ssh
查看是否存在现有 SSH 密钥:
# 列出 ssh 目录下 .ssh 文件 在终端查看
$ ls -al ~/.ssh
- 终端输入
cat ~/.ssh/id_rsa.pub
可以输出公钥内容
- 在 Finder 界面查看。输入命令自动打开 Finder,即可查看
# open命令打开 ssh 秘钥对,隐藏存储目录 .ssh
$ open ~/.ssh
默认情况下,公钥的文件名是 id_rsa.pub
生成新的 SSH 秘钥对
- 打开终端。
- 终端输入下面的命令,把邮箱 **替换成为自己 **的企业邮箱。
$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
这将使用自己的企业的邮箱作为标识,创建一个新的ssh密钥。
注意:相同目录下已经存在的话,会覆盖之前的,如果继续使用,注意备份。
Generating public/private rsa key pair.
- 当系统提示“输入要保存密钥的文件”时,按回车键。使用秘钥对存储位置。默认是
/Users/用户/.ssh/id_rsa
。
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
- 接下来会提示输入密码。密码暂时不配置,忽略提示,连续按两次回车键,完成秘钥对创建。
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]
边栏推荐
- Using requests library and re library to crawl web pages
- Large numbers (C language)
- PHP之一句话木马
- Schematic diagram of UWB ultra high precision positioning system
- Interpretation of yolov5 training results
- RESNET in tensorflow_ Train actual combat
- Create a binary response variable using the cut sub box operation
- The beautiful scenery is natural, and the wonderful pen is obtained by chance -- how is the "wonderful pen" refined?
- -Discrete Mathematics - Analysis of final exercises
- LeetCode 19. Delete the penultimate node of the linked list
猜你喜欢
localStorage浏览器本地储存,解决游客不登录的情况下限制提交表单次数。
一个从坟墓里爬出的公司
Decipher the AI black technology behind sports: figure skating action recognition, multi-mode video classification and wonderful clip editing
图解OneFlow的学习率调整策略
Schematic diagram of UWB ultra high precision positioning system
2.< tag-动态规划和常规问题>lt.343. 整数拆分
Use fill and fill in Matplotlib_ Between fill the blank area between functions
6.1 - 6.2 Introduction à la cryptographie à clé publique
2022.2.17
Ai+ remote sensing: releasing the value of each pixel
随机推荐
Day3 data type and Operator jobs
0622 horse palm fell 9%
Windows下安装Tp6.0框架,图文。Thinkphp6.0安装教程
Technical problems to be faced in mobile terminal im development
Multipass Chinese document - use multipass service to authorize the client
Stm8 MCU ADC sampling function is triggered by timer
The best Chinese open source class of vision transformer, ten hours of on-site coding to play with the popular model of Vit!
A method of quickly transplanting library function code to register code by single chip microcomputer
ModuleNotFoundError: No module named ‘numpy‘
LeetCode 19. Delete the penultimate node of the linked list
Decipher the AI black technology behind sports: figure skating action recognition, multi-mode video classification and wonderful clip editing
date_ Range creation date range freq parameter value table and creation example
The beautiful scenery is natural, and the wonderful pen is obtained by chance -- how is the "wonderful pen" refined?
6.1 - 6.2 Introduction à la cryptographie à clé publique
UWB超高精度定位系统架构图
Zuul 實現動態路由
Multipass Chinese document - remove instance
One of token passing between microservices @feign's token passing
202.2.9
一个从坟墓里爬出的公司