This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
SSH 密钥配置
本文介绍如何创建 SSH 公私钥对并添加到 Gitea。
1. 创建 SSH 公私钥对
如果没有现成的 SSH 密钥对,需要先生成一对。
生成命令
ssh-keygen -t ed25519 -C "your_email@example.com"
参数说明:
-t ed25519:使用 Ed25519 算法(推荐,比 RSA 更安全、更短)
-C "your_email@example.com":注释,通常填你的邮箱,便于识别
交互提示
Generating public/private ed25519 key pair.
Enter file in which to save key (/home/you/.ssh/id_ed25519): # 直接回车使用默认路径
Enter passphrase (empty for no passphrase): # 输入密码短语,建议设置,若不设置则直接回车
Enter same passphrase again: # 确认密码短语,若不设置则直接回车