# 科学上网问题 - Tun 模式无法 ssh 访问 Github


<!--post-->

## 问题

开启代理软件的 TUN 模式后，进行 `git push` 会失败，显示

```
Connection closed by 198.18.0.104 port 22
```

由于推送目标是 github，使用下面命令亦可复现

```shell
ssh -T git@github.com
```

## 解决方法

编辑：

```shell
~/.ssh/config
```

加入：

```
Host github.com
  HostName ssh.github.com
  Port 443
  IdentityFile ~/.ssh/id_ed25519
```

该走 HTTPS 连接。

然后重新测试：

```shell
ssh -T git@github.com
```

即可正常连接。


---

> 作者: [fupcode](https://github.com/fupcode)  
> URL: https://fupcode.com/blog/network/problem-tun-github-error/  

