当前位置:网站首页>创建 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]
边栏推荐
- torchvision_transform(图像增强)
- Wechat applet exits the applet (navigator and api--wx.exitminiprogram)
- Resample
- Method of saving pictures in wechat applet
- -Discrete Mathematics - Analysis of final exercises
- Using requests library and re library to crawl web pages
- C# 39. string类型和byte[]类型相互转换(实测)
- YOLOv5-6.0的一些参数设置和特征图可视化
- PHP one sentence Trojan horse
- 两步处理字符串正则匹配得到JSON列表
猜你喜欢

The beautiful scenery is natural, and the wonderful pen is obtained by chance -- how is the "wonderful pen" refined?

广和通联合安提国际为基于英伟达 Jetson Xavier NX的AI边缘计算平台带来5G R16强大性能

Créateur de génie: cavalier solitaire, magnat de la technologie et ai | dix ans d'apprentissage profond

Zuul 实现动态路由

Genius makers: lone Rangers, technology giants and AI | ten years of the rise of in-depth learning

ROS notes (07) - Implementation of client and server

Record a circular reference problem

Codeforces Round #802 (Div. 2)(A-D)

【Latex】错误类型总结(持更)

How to select the data transmission format of instant messaging application
随机推荐
PHP之一句话木马
2.22.2.14
2. < tag dynamic programming and conventional problems > lt.343 integer partition
Interpretation of yolov5 training results
Tensorflow and deep learning day 3
[IDE(ImageBed)]Picgo+Typora+aliyunOSS部署博客图床(2022.6)
-Discrete Mathematics - Analysis of final exercises
Using requests library and re library to crawl web pages
Day4 branch and loop jobs
How to select the data transmission format of instant messaging application
LSTM in tensorflow_ Layers actual combat
Multipass Chinese document - remote use of multipass
Codeforces Round #800 (Div. 2)
[greedy college] recommended system engineer training plan
Simple application of KMP
【Unity3D】碰撞体组件Collider
Schematic diagram of UWB ultra high precision positioning system
Record a circular reference problem
Multipass Chinese document - use instance command alias
Collections and dictionaries