Github授权新的设备ssh接入

为Mac生成公钥

步骤:

  • 检查本机是否已有公钥
    ls -la ~/.ssh
  • 将原来的公钥删除
    rm -rf ~/.ssh
  • 生成新的公钥(填自己的邮箱),然后除了密码,一路默认
    ssh-keygen -t ras -C "xxxx@domain.com"

在默认的路径下便生成了自己的id_ras.pub

  • 查看id_ras.pub的内容
    cat path/to/id_ras.pub
  • 将id_rsa.pub中的内容拷贝

在Github中授权

  • 打开Github,点击头像->Setting
  • 然后点击左边栏的SSH and GPG keys
  • 在SSH keys右边点击New SSH key
  • 填入一个SSH key的tittle, key框内粘贴如上一步来自Mac的id_ras.pub内容Add SSH key
  • 点击Add SSH key
    到此设备授权成功。
posted @ 2019-03-06 16:22  HOU_JUN  阅读(916)  评论(0编辑  收藏  举报