vscode remote-ssh 远程连接Centos服务器无法拉取GitHub代码问题

先看下能不能访问 github

ping github.com

如不能访问需要配置 host,访问网址:https://www.ipaddress.com/,查找github最新的ip地址,进行hosts配置

140.82.114.4 github.com
199.232.69.194 github.global.ssl.fastly.net

重启host

/etc/init.d/network restart
# ipconfig/flushdns # windows 

拉取代码时报错

fatal: remote error: 
  The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

需要手动关闭ssl验证

git config --global http.sslverify false

提交代码需要配置账号信息

git config --global user.name "xxx"
git config --global user.email "xxx@gmail.com"

配置ssh-key私钥

添加ssh-key私钥到 ssh-agent,首先确保ssh-agent 正常工作,结果类似:Agent pid 94457 即为正常

eval $(ssh-agent -s)

登录 GitHub 找到 setting SSH 配置复制私钥到 /root/.ssh/id_rsa.pub

vim /root/.ssh/id_rsa.pub
posted @   weichangk  阅读(458)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
点击右上角即可分享
微信分享提示