I asked for help on stackoverflow and I was told it is more than likely a Ubuntu problem and was recommended to ask here.
I'm trying to clone a private git repo to my web folder on Ubuntu. I've created the SSH key pair & added it to my account settings on githubs end.
ssh-add ~/.ssh/id_ed25519Identity added: /home/ubuntu/.ssh/id_ed25519 (email)
ssh -vT git@github.com
Hi CNRP! You've successfully authenticated, but GitHub does not provide shell access. debug1: channel 0: free: client-session, nchannels 1 Transferred: sent 2148, received 2336 bytes, in 0.2 seconds Bytes per second: sent 10468.5, received 11384.7
I've tried the following and all respond with similar errors.
git clone git@github.com:CNRP/project-name.gitfatal: could not create work tree dir 'project-name': Permission denied
sudo git clone git@github.com:CNRP/project-name.git > git@github.com: Permission denied (publickey). fatal: Could not read > from remote repository. > > Please make sure you have the correct access rights and the repository > exists.
git clone https://-token-@github.com/CNRP/project-name.git > fatal: could not create work tree dir 'project-name': Permission > denied
The folder I'm trying to clone to is the /var/www/ web folder. I'm thinking its possibly something todo with user permissions? I've troubleshooted all the github authentication steps and repeated it multiple times so I'm thinking the SSH authentication isn't the problem.
Any help on what I can do from here to work this out is highly appreciated, Its left me stumped!
sudo
, git is presumably looking for SSH keys in root's home directory – steeldriver Feb 12 '23 at 01:00sudo
in the first place - fix the permissions of the directory so that your user has the necessary access rights for it. – muru Feb 12 '23 at 03:31