Git权限被拒绝,但是可以通过git shell SSH

时间:2019-05-31 17:21:36

标签: git authentication github ssh

我刚安装了Git,生成了SSH对,并将SSH密钥添加到了我的github帐户。毕竟,我已经在Git Shell中运行了ssh -T git@github.com,并且收到了有关成功的消息:

Hi username! You've successfully authenticated, but Github does not provide shell access.

然后我尝试推送我的项目提交:使用git init创建存储库,进行提交,添加远程:git remote add origin git@github.com:username/Project.git,但是在使用git push origin master之后,我得到了

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

我的SSH对在C://Users/PCUser/.ssh内部。

编辑:此外,config中没有C://Users/PCUser/.ssh文件,只有2个文件:usernameusername.pub。这可能是原因吗? config中有一个MyProject/.git文件:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
[remote "origin"]
    url = git@github.com:username/MyProject.git
    fetch = +refs/heads/*:refs/remotes/origin/*

0 个答案:

没有答案