更新 配置 Git SSH 与 Gitea 集成指南
@@ -17,6 +17,7 @@ ssh-keygen -t ed25519 -C "your_email@example.com"
|
||||
|
||||
1. 登录你的 Gitea 实例:http://175.27.253.162:3000/
|
||||
2. 点击右上角用户头像 → Settings(设置)
|
||||

|
||||
3. 在左侧菜单中选择 SSH / GPG 密钥 → 管理 SSH 密钥
|
||||
4. 打开公钥文件(如 ~/.ssh/id_ed25519.pub),复制其全部内容
|
||||
```bash
|
||||
@@ -25,7 +26,9 @@ ssh-keygen -t ed25519 -C "your_email@example.com"
|
||||
5. 在 Gitea 的 密钥内容文本框中粘贴公钥内容
|
||||
6. 密钥名称可填写设备名称
|
||||
7. 点击 **添加密钥** 完成添加
|
||||

|
||||
|
||||

|
||||
|
||||
# 测试 SSH 连接
|
||||
在终端运行以下命令测试是否能成功连接到 Gitea 服务器:
|
||||
@@ -37,3 +40,4 @@ ssh -T ssh://git@175.27.253.162:222
|
||||
Hi username! You've successfully authenticated, but Gitea does not provide shell access.
|
||||
````
|
||||
这表示 SSH 认证已生效。
|
||||

|
||||
|
||||
Reference in New Issue
Block a user