jlengstorf / code.lengstorf.com

A blog for me to nerd the fuck out.
https://code.lengstorf.com
ISC License
7 stars 3 forks source link

NodeJS Digital Ocean ssl deploy: Github authentication not working #26

Closed gberg1 closed 5 years ago

gberg1 commented 5 years ago

@gatsbyjs Hi great material so far. I've followed your tutorial step by step and everything was working until I got to cloning the git repo via ssh into the user apps folder on the Digital Ocean droplet.

I confirmed that the SSH key on Digital Ocean (set up at the beginning) as well as in the authorized_keys file, and on Github are all the same. Can you please advise on how to trouble shoot this?

git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

gberg1 commented 5 years ago

I was able to get it to work with https but not sure why ssh wouldnt work

jlengstorf commented 5 years ago

@gberg1 usually this means that your public key isn't added to GitHub. Check out this doc for troubleshooting steps: https://help.github.com/en/articles/error-permission-denied-publickey

Thanks!

gberg1 commented 5 years ago

@jlengstorf thanks! Its weird because I have the same public key added to github as i am unable to add it a second time (made sure its the same one located at /.ssh/id_rsa.pub Separately, I noticed my pm2 server has the wrong info for script path and exec cwd (this is because I originally set up pm2 and the apps/app.example.com directory to be a different name, rather than what im using now. I changed the apps/app.example.com directory to be the same as the pm2 show server details mentioned above, but this is different than what my actual domain is. Will this be an issue? How would you suggest I update the pm2 script path and exec cwd so its consistent with my actual domain name? I looked at pm2 documentation but wasn't able to find anything. Thanks again for the great info. You are the man

jlengstorf commented 5 years ago

Updating the path names should only require renaming them and making sure you update all references to the path. Worst-case, you may want to go back in the tutorial and step through it again using the updated name.

Good luck!