Git and Amazon EC2 public key denied

Posted by MrNart on Server Fault See other posts from Server Fault or by MrNart
Published on 2012-09-02T18:06:55Z Indexed on 2012/09/03 15:40 UTC
Read the original article Hit count: 263

Filed under:
|
|

I had git working before on /var/html/projectfolder and realized it was a security risk so I made a new folder /projects from the root folder and tried to replicate what I did and now it doesnt work.

Here is the backlog of what I did for my local machine and EC2 - server

Server-EC2 1.I added my public key to the authorized_user file in ~/.ssh folder 2.Create a bare repository

git init --bare

3.Change folder permissions to

sudo chgrp -R ec2-user *
sudo chmod -R g+ws *

Local Machine

  1. create a local repository with git init
  2. touch, add, commit readme file
  3. pointed origin master to ec2 via

    git remote add origin ssh://ec2-user@remote-ip/path/to/folder

This is my output:

Permission Denied (publickey)
fatal: The remote end hung up unexpectedly

© Server Fault or respective owner

Related posts about git

Related posts about amazon-ec2