权限被拒绝(publickey)。致命:无法从远程存储库读取。与转售商托管

时间:2017-02-22 16:33:41

标签: git github ssh ssh-keys git-remote

我正在尝试在我的经销商托管帐户(inmotion托管)中设置githook。我为git设置了git init --bare和配置post-receive文件的文件夹,并在git中添加了远程ssh。当我运行git remote -v

origin  https://github.com/{username}/{projectname}.git (fetch)
origin  https://github.com/{username}/{projectname}.git (push)
production      ssh://{hostingusername}@{domain-name}:{port}/repo/site.git (fetch)
production      ssh://{hostingusername}@{domain-name}:{port}/repo/site.git (push)

我收到错误

Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

尝试跑步时

git push production master

1 个答案:

答案 0 :(得分:1)

如果您使用的是共享主机,请检查您的目录路径。我对此表示怀疑。我也有同样的麻烦。