Skip to content

配置gitee_SSH公钥

  1. 登录gitee网址,注册一个账号并登录,点击右上角个人账号进入到”设置“ alt text

  2. 找到SSH 公钥,进行添加公钥 alt text

  3. 可以参考怎样生成公钥进行生成,mac或windows的命令行下,执行命令:

# 执行命令
ssh-keygen -t ed25519 -C "Gitee SSH Key"

# 中间通过三次回车键确定
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/git/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/git/.ssh/id_ed25519
Your public key has been saved in /home/git/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:ohDd0OK5WG2dx4gST/j35HjvlJlGHvihyY+Msl6IC8I Gitee SSH Key
The key's randomart image is:
+--[ED25519 256]--+
|    .o           |
|   .+oo          |
|  ...O.o +       |
|   .= * = +.     |
|  .o +..S*. +    |
|. ...o o..+* *   |
|.E. o . ..+.O    |
| . . ... o =.    |
|    ..oo. o.o    |
+----[SHA256]-----+

# 读取公钥pub文件
cat ~/.ssh/id_ed25519.pub

# 将id_ed25519.pub内容贴到步骤2中公钥处
  1. mac或windows 命令下验证, 若出现You've successfully表示添加成功
$ ssh -T git@gitee.com
Hi USERNAME! You've successfully authenticated, but GITEE.COM does not provide shell access.