0

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

Community
  • 1
  • 1
ChrisRich
  • 8,300
  • 11
  • 48
  • 67

1 Answers1

1

Okay, I know why it failed.

When going: sudo chown -R bitnami apps

I needed to run that command as root and not as the user I'm granting the rights to.

ChrisRich
  • 8,300
  • 11
  • 48
  • 67