# 给ssh设置代理 1. 编辑 `~/.ssh/config` 文件,添加以下内容: ``` Host github.com Hostname github.com User git Port 22 ProxyCommand nc -X connect -x 127.0.0.1:1080 %h %p ``` 这里的nc是使用的BSD nc,如果是gnu nc则不行。如archlinux。需要安装 socat ``` sudo pacman -S socat ``` 最后一行需要改为: ``` ProxyCommand socat - PROXY:127.0.0.1:%h:%p,proxyport=1080 ``` 或 ProxyCommand socat - SOCKS5:127.0.0.1:%h:%p,socksport=1080 ``` 。