I have setup with guthub with a previous github account on this computer called myaccount when i run this command
ssh -T git@github.com
Hi myaccount! You\'ve su
GitHub recognizes you as myaccount
because SSH is using a key that corresponds to a public key that has been added to the myaccount
account on the GitHub website.
If you want to switch entirely to using the sameueleast
account instead of myaccount
, you can do the following:
myaccount
samueleast
id_rsa.pub
or id_dsa.pub
and be in your .ssh
directory.On the other hand, if you want to be able to use either myaccount
or samueleast
when pushing to GitHub, you will need to create aliases for git@github.com
in ~/.ssh/config
, such as:
Host github-myaccount
User git
Hostname github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_dsa-myaccount.pub
Host github-samueleast
User git
Hostname github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_dsa-samueleast.pub
That assumes you've generated a second SSH keypair and given them names as above. Then you need to make sure that you are using the appropriate alias in the URLs of your git remotes. For example, if you want to change your origin
remote so that pushing to origin means "pushing to origin as samueleast", you could do:
git remote set-url origin \
git@github-samueleast:samueleast/Samuel-East-S3-Audio-Playlist-Player.git