ssh 通过 443 访问 github - github access from behind a firewall

ssh 通过 443 访问 github - github access from behind a firewall

在 SSH 默认端口 22 被屏蔽时,

hallo@hallo /usr/bin
$ ssh -T [email protected]
ssh: connect to host github.com port 22: Connection timed out

可以使用 443 端口访问 github 。

 

 

这里在 cygwin 环境中做演示:

1. 在 /home/hallo/.ssh 目录中添加配置文件 config 。

Host github.com
User [email protected]
Port 443
Hostname ssh.github.com
identityfile ~/.ssh/id_rsa

2. clone 仓库到本地。

kysnail@kysnail /cygdrive/f/Books/gitrepo
$ git clone [email protected]:xxx/xxx.git
Cloning into 'PHP'...
remote: Counting objects: 23, done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 23 (delta 0), reused 23 (delta 0)
Receiving objects: 100% (23/23), 3.26 KiB, done.

 如果仍然无法使用重新安装ssh,

sudo apt-get remove openssh-server openssh-client

sudo apt-get install openssh-server openssh-client

你可能感兴趣的:(ssh 通过 443 访问 github - github access from behind a firewall)