Host github.com Hostname ssh.github.com IdentityFile "~/.ssh/id_rsa" User git Port 22 ProxyCommand netcat -X connect -x 127.0.0.1:7890 %h %p TCPKeepAlive yes
Host ssh.github.com Hostname ssh.github.com IdentityFile "~/.ssh/id_rsa" User git Port 443 ProxyCommand netcat -X connect -x 127.0.0.1:7890 %h %p TCPKeepAlive yes
总结
修改配置文件后,检查 ssh 协议的连通情况:
1 2 3 4 5 6
eaglebear2002@ubt-pc:~/.ssh$ ssh -T git@github.com The authenticity of host 'ssh.github.com (<no hostip for proxy command>)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This host key is known by the following other names/addresses: ~/.ssh/known_hosts:1: [hashed name] Are you sure you want to continue connecting (yes/no/[fingerprint])?