Can not receive the public key (Permission denied (publickey))

Hi guys,

There has been similiar topics here but I checked them and they all seemed to have a little bit different problem from mine.

I am a complete noob when it comes to GitLab and just started to use it because we use it in one of our classes in my university so any help would be highly appreciated. So the situation is as follows: I generated and ssh key and added it to my profile on https://gitlab.labranet/profile/keys. However, after trying the connection it ended up the server replying “Permission denied (publickey)”. I tried debugging and got back the following log (I omitted the beginning because there were too many “links” and apparently they are not allowed for a new user)

debug1: Offering public key: /c/Users/Me/.ssh/id_ed25519 ED25519 SHA256:L/Hfvh2cD/Qt0Rfod9+eICRcrJGuaNKGpraupvK30bM
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug1: Trying private key: /c/Users/Me/.ssh/id_xmss
debug3: no such identity: /c/Users/Me/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try. Permission denied (publickey).

It seems to be looking for some kind of files that don’t even exist in the folder from the beginning but I’m not sure whether that is the problem and even if it is, how i can solve it.

If you can help me out in anyway, that would be great! Thank you.

Hi @Aconi, and welcome to the Community forum!

Can you manually confirm the location of both your public and private key files? If you did not use the default path for these, then you will need to do some extra configuration to your SSH client. See the document here: Working with non-default SSH key pair paths.

You may also consider creating a new SSH key pair for GitLab entirely. Here is our guide that walks you through the process step-by-step, from generating the key to installing it: Generating a new SSH key pair.