Permission denied on the git clone of my own private repo on the remote server - although I added a new public key and that's it

I installed a server instance (Amazon EC2, Ubuntu 12.x) and got stuck trying to clone my own private repo from git.

I watched https://help.github.com/articles/generating-ssh-keys and https://help.github.com/articles/error-permission-denied-publickey for a while, but still nothing good.

I created a new ssh key pair on a remote computer using

ssh-keygen -t rsa -C "myemailaddress@myemail.com" 

and configure the git setting , and I added the public key to my github account . The email address is the same as the one I use on my local computer ssh key (I don't know if that matters).

After running ssh-agent and then running ssh-add -l , I get a fingerprint result that matches what is said in my public github public key. ssh -T git@github.com also tells me that I have successfully authenticated.

However when i try

 git clone https://github.com/dmonopoly/myprivateproject.git 

or

 git clone git@github.com:dmonopoly/myprivateproject.git 

on the remote computer (which I laid out), I get this error:

 fatal: could not create work tree dir 'myprivateproject'.: Permission denied 

Ideas? I used to handle permission denied (public key) , but that seems different. Help evaluate.

+8
git github ssh
source share
2 answers
 fatal: could not create work tree dir 'myprivateproject'.: Permission denied ^^^^^^^^^^^^^^^^^^^^ 

This has nothing to do with access to the repository. You are trying to clone it into a directory in which you do not have write access. Check permissions on git clone machine .

+13
source share

sudo before the team took care of this for me. It’s easier to keep track of a folder that requires a permission change.

0
source share

All Articles