设备添加ssh 给git仓库
Generating a new SSH key pair
Before creating an SSH key pair, make sure to understand the
different types of keys.
To create a new SSH key pair:
- Open a terminal on Linux or macOS, or Git Bash / WSL on Windows.
- Generate a new ED25519 SSH key pair:
ssh-keygen -t ed25519 -C "email@example.com"
Or, if you want to use RSA:
ssh-keygen -t rsa -b 4096 -C "email@example.com"
The -C flag adds a comment in the key in case you have multiple of them
and want to tell which is which. It is optional. - Next, you will be prompted to input a file path to save your SSH key pair to.
If you don't already have an SSH key pair and aren't generating a deploy key,
use the suggested path by pressing
Enter. Using the suggested path will normally allow your SSH client
to automatically use the SSH key pair with no additional configuration.
If you already have an SSH key pair with the suggested file path, you will need
to input a new file path and declare what host
this SSH key pair will be used for in your~/.ssh/config
file. - Once the path is decided, you will be prompted to input a password to
secure your new SSH key pair. It's a best practice to use a password,
but it's not required and you can skip creating it by pressing
Enter twice.
If, in any case, you want to add or change the password of your SSH key pair,
you can use the -p flag:
ssh-keygen -p -f <keyname>
Adding an SSH key to your GitLab account
-
Copy your public SSH key to the clipboard by using one of the commands below
depending on your Operating System:
macOS:
pbcopy < ~/.ssh/id_ed25519.pub
WSL / GNU/Linux (requires the xclip package):
xclip -sel clip < ~/.ssh/id_ed25519.pub
Git Bash on Windows:
cat ~/.ssh/id_ed25519.pub | clip
You can also open the key in a graphical editor and copy it from there,
but be careful not to accidentally change anything.
NOTE: Note:
If you opted to create an RSA key, the name might differ. -
Add your public SSH key to your GitLab account by:
1.Clicking your avatar in the upper right corner and selecting Settings.
2.Navigating to SSH Keys and pasting your public key in the Key field. If you:
- Created the key with a comment, this will appear in the Title field.
- Created the key without a comment, give your key an identifiable title like Work Laptop or Home Workstation.
3.Click the Add key button.
NOTE: Note:
If you manually copied your public SSH key make sure you copied the entire
key starting with ssh-ed25519 (or ssh-rsa) and ending with your email.
原文地址:https://www.cnblogs.com/Acheng20/p/15060855.html
- 编程的智慧特点
- 【机器学习】机器学习大白话
- 回归分析技术|机器学习
- 用PHP蜘蛛做旅游数据分析
- 一秒找出用时间和随机数生成的上传文件名
- Java之集合的遍历与迭代器
- Java之字符串String,StringBuffer,StringBuilder
- JavaScript深入浅出补充——(一)数据类型,表达式和运算符
- Oracle数据库(一)概述、基础与简单操作
- Oracle数据库(二)常用关键字以及函数
- Oracle数据库(三)表操作,连接查询,分页
- 正式学习第一天下午——基础标签及其属性
- 正式学习第二天上午——常用标签及列表 0605
- Java之面向对象例子(三) 多态,重写,重载,equals()方法和toString()方法的重写
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- 比较两个等长的字符串,若相同,则输出Match!,若不同,则输出No Match!
- 逻辑回归算法原理及实现
- Python链表详细笔记
- 26个你需要学习的Firefox配置技巧,改进体验和加快浏览器响应速度
- Softmax算法原理及实现
- Android Activity 活动的生命周期
- Android学习笔记,不断更新
- cJSON,c语言的JSON库!
- 自己动手实现4大免费聊天机器人:小冰、图灵、腾讯、青云客
- Android Spinner下拉框的基本使用
- hadoop本地运行的两个案例。官方Grep案例、官方WordCount案例。
- 腾讯智能闲聊机器人详细开发教程
- 用PyTorch实现MNIST手写数字识别(非常详细)
- 手把手教你从零开始用Java写爬虫
- STM32 cjson的GBK/UTF-8/UNICODE转换、显示中文、GBK字库