Git and Amazon EC2 public key denied
- by MrNart
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
create a local repository with git init
touch, add, commit readme file
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