git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

发布时间:2023-12-23 16:27:09
github提交代码报没有权限

```
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
```

分别执行如下命令

```
1. ssh-keygen -t rsa -C "xx@example.com"
xx@example.com 替换为github的登录邮箱

2. ssh-agent -s

3.ssh -T git@github.com

```


再找用户目录下的ssh信息

ls -a

cd .ssh

找到id_rsa.pub 

将里面的全部内容取出来


再在github账号中找到下面的菜单


复制到key中,并创建


Card image cap
APP STORE
Card image cap
应用宝
Card image cap
小米
Card image cap
华为