Skip to content

Commit d219af3

Browse files
committed
Add section on SSH access issues with GitHub in specific environments, including troubleshooting steps and configuration for using port 443. This addresses common connectivity problems faced in restrictive network settings.
1 parent 3f877d1 commit d219af3

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

‎content/计算机/ssh.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- [4. Proxy Forwarding](#4-proxy-forwarding)
88
- [5. ssh via proxy](#5-ssh-via-proxy)
99
- [6. proxy using ssh](#6-proxy-using-ssh)
10+
- [7. 特殊环境下ssh无法访问github问题](#7-特殊环境下ssh无法访问github问题)
1011

1112
## 1. Basic Usage
1213

@@ -103,3 +104,30 @@ Host server_ip
103104
```
104105
ssh -D {local port} {username}@{server}
105106
```
107+
108+
## 7. 特殊环境下ssh无法访问github问题
109+
110+
一些公司、学校实验室的防火墙,或者某些运营商,为了安全起见,会封锁 22 端口
111+
112+
使用ssh git clone会出现以下错误
113+
114+
```bash
115+
zengls188@dell-Precision-7960-Tower ~/proj> git clone git@github.com:xxx/yyy.git
116+
Cloning into 'yyy'...
117+
ssh: Could not resolve hostname github.com: Temporary failure in name resolution
118+
fatal: Could not read from remote repository.
119+
120+
Please make sure you have the correct access rights
121+
and the repository exists.
122+
```
123+
124+
解决办法:
125+
126+
在`~/.ssh/config`中添加如下配置
127+
128+
```
129+
Host github.com
130+
Hostname ssh.github.com
131+
Port 443
132+
User git
133+
```

0 commit comments

Comments
 (0)