The ssh configuration in github seems to be a nightmare. I have multiple github accounts, but for which I can have multiple ssh keys. In the github ssh configuration section they mention this...
ssh-keygen -t rsa -C "email@example.com"
# Creates a new ssh key, using the provided email as a label
# Generating public/private rsa key pair.
We strongly suggest keeping the default settings as they are, so when you're prompted to "Enter a file in which to save the key", just press Enter to continue.
ssh -vT firstname.lastname@example.org
Hi animesh11! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3128, received 1976 bytes, in 0.5 seconds
Bytes per second: sent 6077.0, received 3838.9
debug1: Exit status 1
Please make sure you have the correct access rights
I am up to my wits end why the ssh -vT works and simple cloning doesn't. It doesn't seem logical, why would github put this step in the manual if they know it's freaking useless.
I'd use .ssh config to set up different configurations for each particular user.
For example, edit (or create) the config file in the .ssh folder under your users root, and add something similar to this:
Host user1-github HostName github.com User git IdentityFile ~/.ssh/user1_rsa Host user2-github HostName github.com User git IdentityFile ~/.ssh/user2_rsa
user2_rsa are the outputs of
ssh-keygen -t rsa -C "email@example.com" and
ssh-keygen -t rsa -C "firstname.lastname@example.org"
Then, when testing simply use
ssh -vT user1-github and
ssh -vT user2-github.
Also, when cloning repos use
git clone user1-github:username1/project.git or
git clone user2-github:username2/project.git.