[linux] git push时需要输入user 和keyword

git clone的要是ssh链接!!!!

1、用户名和邮箱

git config --global user.name "name"

git config --global user.email "email"

2、生成ssh key (ED25519)

ssh-keygen -t ed25519 -C "<自定义内容>"

3、复制第二步的ssh,到gitlab的"个人设置-ssh公钥"里。

4、创建/root/.ssh/config

HostName xx.xxyun.com

PreferredAuthentications publickey

IdentityFile /root/.ssh/id_ed25519

或者

Host github.com

HostName github.com

User git

IdentityFile /Users/xin/.ssh/id_ed25519

然后

ssh-add /root/.ssh/id_ed25519

5、设置密钥权限

chmod 600 /root/.ssh/id_ed25519.pub

6、测试是否成功

ssh -T git@xx.xxyun.com

或者

ssh -T github.com

git checkout -b xin

git push --set-upstream origin xin

相关推荐
fwerfv34534517 分钟前
Python 爬虫实战:玩转 Playwright 跨浏览器自动化(Chromium/Firefox/WebKit 全支持)
linux
华为云开发者联盟35 分钟前
华为开发者空间携手乐知行:轻松实现智能网联小车数据可视化系
人工智能·华为开发者空间
vortex539 分钟前
Shell脚本技巧:去除文件中字符串两端空白
linux·bash·shell·sed·awk
云卓SKYDROID44 分钟前
飞控信号模块技术要点与难点分析
人工智能·无人机·航电系统·高科技·云卓科技
文火冰糖的硅基工坊1 小时前
[嵌入式系统-101]:AIoT(人工智能物联网)开发板
人工智能·物联网·重构·架构
说私域1 小时前
开源AI智能名片链动2+1模式S2B2C商城小程序在个性化与小众化消费崛起中的营销宣传策略研究
人工智能·小程序
world-wide-wait1 小时前
python高级04——网络编程
linux·服务器·网络
AI小云1 小时前
【Python与AI基础】Python编程基础:读写CSV文件
人工智能·python
迎風吹頭髮1 小时前
Linux内核架构浅谈26-Linux实时进程调度:优先级反转与解决方案
linux·服务器·架构
酷雷曼VR全景1 小时前
系统升级丨让VR全景制作更全面、更简单
人工智能·科技·vr·vr全景·酷雷曼