- ssh-keygen -t rsa -C <你的gitlab对应使用邮箱> 生成 SSH 密钥
- cd ~/.ssh 切换当前工作目录到SSH 密钥文件通常存储的默认位置(如果是命令行 就 cd 过去)
- cat id_rsa.pub 打印公钥文件的内容 (如果是命令行 就用 type id_rsa.pub)
- 复制密钥(密钥开头应该是 以 'ssh-rsa'、'ssh-dss'、'ecdsa-sha2-nistp256'、'ecdsa-sha2-nistp384'、'ecdsa-sha2-nistp521'、'ssh-ed25519'、'sk-ecdsa-sha2-nistp256@openssh.com',或'sk-ssh-ed25519@openssh.com' 开头。
- gitlab中添加新密钥
SSH 密钥过期怎么办?
最新推荐文章于 2025-02-06 15:28:12 发布