- 安装代理
bash
sudo apt update
sudo apt install -y netcat-openbsd
- 配置
~/.ssh/config文件,没有则创建 - 配置ssh公钥
bash
# 输入一直回车即可
ssh-keygen -t ed25519
# 粘贴.pub文件中的密钥到你的github上的ssh-key配置中
cat ~/.ssh/id_ed25519.pub
- 配置如下内容进行代理
bash
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
ServerAliveInterval 60
ServerAliveCountMax 3
ProxyCommand nc -x 127.0.0.1:7890 %h %p
- 无需重启,直接测试是否联通
ssh -T git@github.com - 以上配置后为了使用claude code 安装插件使用