I'm trying to clone a private git repo into an Amazon AWS EC2 instance (Bitnami MEAN stack running Linux)
I have created ssh keys for the user "bitnami" and added the public key to my Github account.
Problem is that the user "bitnami" does not have sufficient permissions:
bitnami@ip-xxx-xx-xx-xx:~/apps$ git clone git@github.com:MyGitUserName/MyRepoName.git
fatal: could not create work tree dir 'MyGitRepo'.: Permission denied
One solution would be to switch to root user: $ sudo su
But to my surprise the ssh keys I generated for the "bitnami" user do not exist for root user. At least, the /.ssh directory is missing the ssh keys when I switch to root user and reappear when I change back to the "bitnami" user.
So, what the best approach here? I want the "bitnami" user to have read/write/executable rights to the ~/apps folder.
Looking at this answer: Could not create work tree dir 'example.com'.: Permission denied
I tried:
sudo chown -R bitnami apps
But I get the same error