skip to Main Content

I seem to be having some issues with SSH and Github on my EC2 instance. I am trying to clone a Github repo and am having permission errors, but when checking my SSH connection it seems to be fine. I have tried deleting and adding the key to Github amongst other things. Any insight would be greatly appreciated.

Result from checking github SSH

Result from attempting to clone Github repo

2

Answers


  1. When you run the clone you’re using sudo which means that your ~/.ssh is different (/root/.ssh vs /home/ubuntu/.ssh) from the first command. I’m guessing that you’re doing this so you have permission to write into /var/www.

    If you need to write to this directory one was is to change the permission in it (i.e. sudo chmod 777 /var/www). However, I’d really advise against this as you don’t want a bug to allow anyone to write into this directory.

    The other way is to checkout the code to a local directory (i.e. /home/ubuntu/www) and then move the files there with sudo (i.e. sudo mv /home/ubuntu/www/* /var/www).

    Login or Signup to reply.
  2. You are trying to use ssh method to clone a repository. To clone a repository using the ssh method you need to complete verification. You can skip all the hassle and can directly clone the repository using the repository link. Try using the command

    git clone https://github.com/JSutliff/webServicesIndex html
    

    and the repository will be cloned in the folder named html without any verification.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search