1.首先要自己搭建一个代理

https://blog.csdn.net/Jessica_hhh/article/details/133276101icon-default.png?t=N7T8https://blog.csdn.net/Jessica_hhh/article/details/133276101

2. 确认机器装过nc,若没有,用`yum install -y nc`安装

centos 6使用yum安装软件_duang_huang的博客-CSDN博客

3. 修改ssh设置,在目录vim ~/.ssh/config

```

Host github.com

    Hostname ssh.github.com

    User git

    Port 443

    PreferredAuthentications publickey

    IdentityFile ~/.ssh/id_rsa

    ProxyCommand nc -X connect -x 123.123.1.2:7890 %h %p

#        ProxyCommand nc --proxy 123.123.1.2:39670 %h %p

    ServerAliveInterval 20

```

4. 如果`nc`命令出问题可以参考这个链接Connect with SSH through a proxy - Stack Overflow

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐