GitHub recognizes you as myaccount because SSH uses the key corresponding to the public key that was added to the myaccount account on the GitHub website.
If you want to completely switch to using the sameueleast account instead of myaccount , you can do the following:
- Log in to GitHub as
myaccount - Go to Account Settings
- Go to SSH Public Keys
- Remove your public key from this list
- Output
- Log in to GitHub as
samueleast - Go to "Account Settings" β "SSH Public Keys"
- Select "Add another public key" and paste the contents of the public key. You public key will (probably) be called
id_rsa.pub or id_dsa.pub and be in your .ssh .
On the other hand, if you want to use either myaccount or samueleast when clicking on GitHub, you will need to create aliases for git@github.com in ~/.ssh/config , for example:
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
It is assumed that you created a second SSH key pair and gave them names as described above. Then you need to make sure that you use the appropriate alias in the URLs of your git remotes. For example, if you want to change the origin console, so clicking on the origin means "clicking on the origin as samueleast", you can do:
git remote set-url origin \ git@github-samueleast :samueleast/Samuel-East-S3-Audio-Playlist-Player.git
source share