git远程仓库push与pull无权限设置ssh密钥

首先远程仓库有github、gitee等等一些,都是需要设置密钥对才能让你的本机有操作仓库的权限的

ssh 密钥对设置

  1. linux 在 ~/.ssh ,window在Git bash命令行窗口(似乎模拟的linux命令窗口)输入
    1. ssh-keygen -t rsa -C "你的邮箱"
    2. 一路回车不用输入任何信息,生成密钥对
    3. add私钥
      1. 如果报错Could not open a connection to your authentication agent.如下:
        1. eval `ssh-agent`或者后面这个ssh-agent bash
        2. ssh-add ~/.ssh/id_rsa
    4. cat ~/.ssh/id_rsa.pub 查看公钥
  2. git clone (你的仓库的url复制)
    1. ​​​​​​​​​​​​​​

猜你喜欢

转载自blog.csdn.net/noDr_butTry/article/details/81776091