「之岙」

「之岙」

如何为Github添加ssh

前置#

终端 git、ssh-keygen 命令正常使用

检查系统内是否已经有 ssh 密钥#

Linux、MacOS 终端执行:

ls ~/.ssh
git 全局配置#
git config --global user.name 你的用户名

粟子:git config --global user.name zhiao

git config --global user.email 你的邮箱

粟子:git config --global user.email [email protected]

生成秘钥#
ssh-keygen -t rsa -C '你上面git配置的邮箱'

粟子:ssh-keygen -t rsa -C '[email protected]'

将公钥粘贴进 Github#

github-> 右上角头像 ->setting->SSH and GPG keys->New SSH key

  1. 起个 Title
  2. 终端进入~/.ssh 目录,将.pub 结尾的文件内容粘贴到 Key 中
  3. Add SSH key
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.