Skip to content

Commit 10fcbcf

Browse files
authored
Merge pull request #9 from ICS-25Fall-FDU/misc_qa
Add misc Q&A to appendix
2 parents 67568b7 + 16a3bc2 commit 10fcbcf

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
docs/.vitepress/dist
3-
docs/.vitepress/cache
3+
docs/.vitepress/cache
4+
*/.DS_Store

docs/.vitepress/config/zh.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ function sidebarGuide(): DefaultTheme.Sidebar {
6565
items: [
6666
{ text: '提问的艺术', link: '/appendix/how-to-ask' },
6767
{ text: '使用 SSH 连接服务器', link: '/appendix/ssh-server' },
68-
{ text: '使用 Watt Toolkit 代理访问 GitHub', link: '/appendix/watt_toolkit' }
68+
{ text: '使用 Watt Toolkit 代理访问 GitHub', link: '/appendix/watt_toolkit' },
69+
{ text: '杂项问题 Q&A', link: '/appendix/misc-qa' }
6970
]
7071
},
7172
{

docs/appendix/misc-qa.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# 杂项问题 Q & A
2+
3+
## 1. GitHub SSH 连接端口被占用问题
4+
5+
### 现象描述
6+
7+
执行任何 GitHub **SSH 方式**的仓库指令(如 `git clone git@github.com:ICS-25Fall-FDU/ICS-25Fall-FDU.github.io.git` )出现以下报错:
8+
9+
```bash
10+
ssh: connect to host github.com port 22: Connection refused
11+
致命错误:无法读取远程仓库。
12+
13+
请确认您有正确的访问权限并且仓库存在。
14+
```
15+
16+
运行 `ssh -t git@github.com` 时,出现报错:
17+
18+
```bash
19+
ssh: connect to host github.com port 22: Connection refused
20+
```
21+
22+
### 问题可能原因
23+
24+
大多数校园网、公司网络会屏蔽 SSH 的 22 端口,但允许 HTTPS(443 端口)。
25+
26+
### 解决方法
27+
28+
修改 SSH 配置文件,将 GitHub 的 SSH 端口从 22 改为 443。
29+
30+
1. 用任意文本编辑器(比如 VSCode,Nano 等)打开 SSH 配置文件 `~/.ssh/config`
31+
2. 在任意处添加以下内容:
32+
33+
```text
34+
Host github.com
35+
Hostname ssh.github.com
36+
Port 443
37+
User git
38+
```
39+
40+
3. 保存文件并退出编辑器。
41+
4. 重试 `ssh -t git@github.com` 指令,应该可以成功连接了,现象:
42+
43+
```bash
44+
Hi {username}! You've successfully authenticated, but GitHub does not provide shell access.
45+
```

0 commit comments

Comments
 (0)