SSH 公钥设置

Gitee 提供了基于 SSH 协议的 Git 服务,在使用 SSH 协议访问仓库仓库之前,需要先配置好账户 SSH 公钥。

生成 SSH 公钥

Windows 用户建议使用 Windows PowerShell 或者 Git Bash ,在 命令提示符 下无 catls 命令。

  1. 通过命令 ssh-keygen 生成 SSH Key:

    ssh-keygen -t ed25519 -C "Gitee SSH Key"

  • -t key 类型
  • -C 注释

输出,如:

复制代码
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]-----+
  • 中间通过三次回车键确定
  1. 查看生成的 SSH 公钥和私钥:

    ls ~/.ssh/

输出:

复制代码
id_ed25519  id_ed25519.pub
  • 私钥文件 id_ed25519
  • 公钥文件 id_ed25519.pub
  1. 读取公钥文件 ~/.ssh/id_ed25519.pub

    cat ~/.ssh/id_ed25519.pub

输出,如:

复制代码
ssh-ed25519 AAAA***5B Gitee SSH Key

复制终端输出的公钥。

相关推荐
小小小花儿1 小时前
SSH密钥配置(免密连接远程服务器)
服务器·ssh
用什么都重名4 小时前
Git分支合并与远程服务器同步实战:保留关键配置文件
运维·服务器·git
得要找到一束光4 小时前
git详细命令
git·github
2601_961875246 小时前
花生十三公考课程|网课|视频
数据库·windows·git·svn·eclipse·github
EleganceJiaBao9 小时前
【Git】Git reset 完整指南:真正理解 HEAD、暂存区与工作区
git·github·reset
m0_526119409 小时前
ssh key生成,gitee配置ssh
运维·gitee·ssh
qq_3384323710 小时前
VSCode Remote-SSH 远程 Windows Server 卡死的排查与解决
windows·vscode·ssh
着迷不白10 小时前
十、网络客户端工具curl, wget, ssh, scp, sftp, rsync
运维·网络·ssh
我最爱吃鱼香茄子11 小时前
【保姆级】Git配置用户名和邮箱(全局/局部)解决提交记录不识别、贡献图不亮问题
git·gitee·github·小白教程·git配置·程序员开发工具
weixin_5716674111 小时前
git fork 并建立自己的dev分支 保持与源仓库的联系
git