Hi everyone,
I have two gitlab.com accounts, and I use them in two different companies and the same pc.
I’m trying to add my ssh key to the second account from https://gitlab.com/-/profile/keys, but it gives me this error.
Does anybody know how to add the same key on different accounts?
Thank you
As the error says - you cannot. Create another SSH key and use that for the second account.
Since cloning via SSH uses git@gitlab.com it’s a single user, where each SSH key is. Therefore this is the reason why you have to use a separate SSH key for each account, otherwise how can it differentiate to which account to authenticate with.
If it was yourusername@gitlab.com and yoursecondusername@gitlab.com for SSH, then you would be able to use the same SSH key, since it’s also providing a username that it would map to. But this is not possible, since SSH cloning is done via git@gitlab.com and only this hence the requirement for SSH keys to be unique and not shared between accounts.