Skip to content

Instantly share code, notes, and snippets.

View knn90's full-sized avatar
๐Ÿ˜ƒ

Khoi Nguyen knn90

๐Ÿ˜ƒ
View GitHub Profile
@knn90
knn90 / multiple-keys-gitlab.md
Created September 22, 2023 04:32 — forked from dotspencer/multiple-keys-gitlab.md
Multiple Gitlab accounts with multiple ssh keys

Gitlab won't allow reuse of a public ssh key for multiple accounts. To get around this you need to create a second ssh key for the second account.

Create or modify your ~/.ssh/config file:

# normal                                                                                                                                                                  
Host gitlab.com-work_username
     HostName gitlab.com
     PreferredAuthentications publickey
 IdentityFile ~/.ssh/id_rsa