权限被拒绝(公钥)。致命:无法从远程存储库读取。与重新卖主托管
问题描述:
我想在我的经销商托管帐户(inmotion托管)中设置githook。我有一个与git init --bare
git的安装文件夹,并配置post-receive
文件,并添加远程SSH在git.When我运行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
答
如果您使用的是共享主机,请检查您的目录路径。我对此表示怀疑。我也有同样的麻烦回来。
+0
感谢提醒。我在我的目录路径上犯了一个错误。它应该是'home/{username}/repo/site,git' –
你上传你的公钥到服务器了吗?如果使用密码进行身份验证,是否在服务器上启用? – fNek
从git上传公钥到托管服务器? –
您是否在您的GitHub账户(生产回购)中添加了公钥('〜/ .ssh/id_rsa.pub')? –