I’m having a lot of trouble uploading to GitLab from my Mac. My boss believes he has given me the necessary permissions, it’s a matter of SSH keys. Here’s what I’ve done:
- Freshly upload my SSH key (of the ssh-ed25519 variety) to GitLab. What shows in my profile matches what shows from
tr -d '\n' < ~/.ssh/id_ed25519.pub
- Add the following to my .ssh/config:
`% ssh email@example.com`
PTY allocation request failed on channel 0
Welcome to GitLab, @Joymaker2!
Connection to gitlab.com closed.
% ssh Joymaker2@gitlab.com
Joymaker2@gitlab.com: Permission denied (publickey).
I don’t know if the latter result was an expected result or a bad result. Is there something I’m missing here?
.ssh/config matters about identation → so make sure IdentityFile is indented (1 tab) under Host.
Secondly, you’re testing it wrong xD You’re trying to ssh into the server itself, which of course doesn’t work.
From docs, proper test would be:
ssh -T firstname.lastname@example.org
You don’t need to put your username, you’re authenticated by your keys.
If this works, your setup is correct.
So, all you need to do now is clone your project by using SSH link, which would look something like this:
git clone email@example.com:path/to/my/project.git
As @paula.kokic said, you use
firstname.lastname@example.org to connect over SSH - the key knows that it relates to your login in Gitlab. As I’ve quoted from your text above, the first test worked, since you correctly connected with email@example.com - however your subsequent attempt with user: joymaker2 will not work and this is correct response for that.