Fail to configure ssh : permission denied (public key)

I’m confused about setting up the ssh access to my gitlab profile. I was following the tutorial here . I already have an existing pair of keys (created a few months ago in order to connect to a cluster) so i directly went to this part of the tutorial.

The issue occurs to the next part, “Verify that you can connect” when I type
ssh -T gitlab.com.

The first time I had the message where i needed to enter ‘yes’, followed by a permission denied. Since then, I get the message Permission denied (publickey).

When I try with https://gitlab.com I get the message ssh: Could not resolve hostname https://gitlab.com: Name or service not known

The issue is similar to other topics on the forum, but the suggested solutions do not seem suited, I already have all the requested permissions on the .ssh directoy and the files inside…

Thanks

Hi,

You need to provide git as the username:

[ian@elise ~]$ ssh -T git@gitlab.com
Welcome to GitLab, @iwalker!

so git@gitlab.com - yours was without git, so it would attempt to connect using the username of your account on Linux.

Working ! Thanks. This part is quite unclear in the tutorial.

1 Like