Answer the question
In order to leave comments, you need to log in
Using multiple ssh keys for gitlab?
How to use multiple ssh keys for different projects and accounts on the same PC?
I have two gitlab accounts.
In the main account, I work with some projects.
I created an additional account for other projects.
Now I'm setting up ssh for the second account.
I generated ssh, added to gitlab account.
When trying to clone a project:
Enter passphrase for key '/Users/mac-pc/.ssh/id_rsa':
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
'/Users/mac-pc/.ssh/id_rsa'
although it should be knocking on another file, let's say "id_rsa_second" ssh -T [username]@gitlab.com
[username]@gitlab.com: Permission denied (publickey).
Answer the question
In order to leave comments, you need to log in
https://medium.freecodecamp.org/manage-multiple-gi...
this is for github, but the principle is the same.
ssh -i /Users/mac-pc/.ssh/id_rsa_second -T [username]@gitlab.com
Or do the mapping in ~/.ssh/config if you don't want to manually do it every time.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question