Tony Tsang,
Sorry, I meant to type `~/.ssh/config`.
By the way, I even tried adding that info to `/etc/ssh/ssh_config`, no dice.
In any case, if `id_rsa.pub` resides in `~/.ssh`, git via SSH should pick the key up automatically.
Emilio Castro,
That's not necessary since these are all public repos. I only own that one repo, so if necessary, I can add the key but there are others I'm trying to clone but it doesn't work and I can't add my key to them because they are not my repositories and these are public repositories such as Twitter Bootstrap, for example (http://github.com/twbs/bootstrap):
-----
$ cd /var/www
$ mkdir test
$ cd test
$ git clone git@github.com:twbs/bootstrap.git
Cloning into 'bootstrap'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
-----
You need to add your public key to GitHub in order to clone through SSH – even if it is a public repo. Why? Because git needs to authenticate though SSH to GitHub’s servers in order to do the clone. And in order to do that, they need to have your public key.
Thanks, It worked for me thanks a lot