Plurrrr

Thu 03 Oct 2019

Fatal: Could not read from remote repository

In the afternoon I tried to clone a GitHub repository to a virtual machine running Ubuntu 14.04.6. I had copied my private and public key to this virtual machine so I didn't expected any issue. However, when attempting the git clone git@github.com: I got:

Permission denied (publickey). fatal: Could not read from remote repository.

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

Creating a config file inside ~/.ssh with the following contents fixed this:

ServerAliveInterval 30
ServerAliveCountMax 4

host github.com
    HostName github.com
    IdentityFile ~/.ssh/github

The actual fix are the last 3 lines which makes that ssh uses ~/.ssh/github for authentication purposes.