Having trouble logging into an AWS instance using an SSH key? I was too and when I finally figured out what the issue was I was kicking myself. Recently I was called to assist figuring out information about a clients AWS deployment for a project where the original developers were no longer available or answering questions. Most of the instances that I initially worked on had no issues once I was able to obtain the correct SSH key pem file from Amazon. When the project was closing down I was asked to assist backing things up and it appeared the SSH key was failing for two of the instances which also happened to be the oldest two instances (2 years old). Below I describe the error I was seeing via SSH as well as the easy resolution to the problem.
You will receive the below dialogue if the SSH key for the server you are connecting from is configured incorrectly or does not exist at all. bash [web@server git-temp]$ git clone email@example.com:user/project.git Initialized empty Git repository in /home/web/gittemp/.git/ Permission denied (publickey). fatal: The remote end hung up unexpectedly fetch-pack from ‘firstname.lastname@example.org:user/project.git’ failed. [web@server git-temp]$ So…
Adding an SSH key to your github.com account for a Linux server is easy. I did notice that it appeared I was doing something incorrectly but the issue was actually with Internet Explorer and once I switched to Firefox everything went smoothly.
- Open GitHub Account Settings: Open github.com in a browser and login. Click “account” in the top right corner.
**NOTE** Make sure to use a browser other than IE. Firefox works just fine but IE will not open the area to add a new SSH key.