服务器/电脑与代码仓gitlab/github免密连接

git config --global user.name "xxxx"

git config --global user.email "xxxxxx@163.com" #使用注册GitHub的邮箱

生成对应邮箱的密码对

ssh-keygen -t rsa -b 4096 -C "xxxxxx@163.com"

把公钥id_rsa.pub拷贝到github中

Setting----->SSH and GPG keys----->SSH keys------>添加新的keys---->把刚拷贝的公钥复制进去

测试是否成功:ssh -T git@github.com

Hi 22hao! You've successfully authenticated, but GitHub does not provide shell access.

连接成功。

要是这种报错就去把known_hosts文件对应的那条记录删掉,注意不是全部清空,免得其他已经实现免密登录的被干掉了

使用ssh下载代码

先在服务器生成秘钥

再把公钥添加到gitlab中

选择下载ssh方式的代码,这样就可以免密下载了,也可以再后面定义下载下来的名字

相关推荐
源远流长jerry3 小时前
Linux 网络发送机制深度解析:从应用到网线
linux·服务器·网络·网络协议·tcp/ip
goyeer4 小时前
【ITIL4】32服务实践 - 问题管理(Problem Management)
linux·运维·服务器·企业数字化·it管理·itil·it治理
cen__y5 小时前
Linux11(网络编程)
linux·运维·服务器·c语言·网络·网络协议·tcp/ip
CableTech_SQH5 小时前
商业地产和高端酒店该怎么选综合布线解决方案?
运维·服务器·网络
Y\5 小时前
VMware虚拟机已断开连接解决方法(二)
服务器
isyangli_blog5 小时前
vmware 安装 Windows Server 2012
服务器
怀旧,5 小时前
【Linux网络编程】9. 数据链路层
linux·服务器·网络
QotomPC6 小时前
Qotom Q30900GP多网口Mini PC:16网口设计在pfSense与工业网络中的应用
服务器·网络·边缘计算
Liangwei Lin6 小时前
LeetCode 22. 括号生成
linux·运维·服务器
( •̀∀•́ )9206 小时前
Linux 下部署 `social-auto-upload` 遇到的问题及完整解决方案
linux·运维·服务器