Setting up SSH Authentication for Github
Assuming that you want to do this as the root user, the second command you ran is the crux of the problem. You are trying to use SSH authentication to access the GitHub repository, however SSH authentication is not configured (or not configured at all for your GitHub account).
"Adding a new SSH Key to your GitHub account" is the official Github documentation for this and involves generating an SSH key pair and adding the public key to the appropriate place in your Github account (at the time of this writing, this is Settings -> SSH and GPG Keys -> Add new SSH key or, https://github.com/settings/keys).
To summarize the steps are :
- Generate an SSH key (Notice that the instructions vary based on the Operating System)
- Add the key to the locally running ssh-agent to save you from typing the passphrase over and over (of course, this is assuming that you used one to create the key in #1 above)
- Finally adding the SSH key to Github as mentioned previously (https://github.com/settings/keys)
The details for all of this are well documented in the top most link.
ssh -T git@github.com
is the command to use to test your setup once you have followed the steps.
First time git setup
Also, if this is the first time you are using git, then 'First-Time Git Setup' is worth a read and at the bare minimum you should setup your identity by doing:
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com