Search code examples
gitgithubsshssh-keysgit-remote

Permission denied (publickey). fatal: Could not read from remote repository. with re-seller hosting


I'm trying to setup githook in my reseller hosting account (inmotion hosting). I have setup folder for git with git init --bare and configured post-receive file and added remote ssh in git.When i run 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)

I'm getting error

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

while trying running

git push production master

Solution

  • Check your directory path if you are using shared hosting. I have doubt in that. I also had same kind of trouble way back.