Skip to content

Instantly share code, notes, and snippets.

@v1shwa
Created May 24, 2017 06:01
Show Gist options
  • Save v1shwa/3b7d80e6d1145c1133758a971081a400 to your computer and use it in GitHub Desktop.
Save v1shwa/3b7d80e6d1145c1133758a971081a400 to your computer and use it in GitHub Desktop.
GIT - Permission denied <repo> to different_user

FIX 1: Change your ssh config

Host work.github
    HostName github.com
    User WORK_USERNAME
    IdentityFile ~/.ssh/id_work_rsa

Host home.github
    HostName github.com
    User HOME_USERNAME 
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_home_rsa

FIX 2: If you have this & it still doesn't work

kill-all ssh-agent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment