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

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...