Ubuntu - GitHub/GitLab 同时创建 SSH Key

前端之家收集整理的这篇文章主要介绍了Ubuntu - GitHub/GitLab 同时创建 SSH Key前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

GitHub/GitLab 同时创建 SSH Key

  • Step1 - GitLab SSH Key 创建
$ cd ~/.ssh
$ ssh-keygen -t rsa -C "注册的gitlab邮箱"
# 默认名称,直接回车跳过,另外还会提示设置密码,设置密码的话后续登陆会比较麻烦,也直接跳过,创建成功
$ ls
# 得到两个文件: id_rsa.pub、id_rsa
$ 复制 id_rsa.pub 中的内容,即公钥到 GitLab 账户的SSH Keys
  • Step2 - GitHub SSH Key 创建
$ cd ~/.ssh
$ ssh-keygen -t rsa -C "注册的github邮箱"
# 对生成定的秘钥进行重命名为 id_rsa_github,回车,直接跳过提示设置密码,创建成功
$ ls
# 新得到两个文件: id_rsa_github.pub、id_rsa_github
$ 复制 id_rsa_github.pub 中的内容,即公钥到 GitHub 账户的SSH Keys

可能出现问题:
- 1. SSH生成id_rsa,id_rsa.pub后,连接服务器却报:Agent admitted failure to sign using the key错误.

执行命令:
$ ssh-add
原文链接:https://www.f2er.com/ubuntu/352393.html

猜你在找的Ubuntu相关文章