Missing SSH public keys from LDAP #6949

Closed
opened 2025-11-02 07:11:57 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @strk on GitHub (Mar 2, 2021).

I'm still having trouble with public ssh keys synchronization from LDAP.
I have added 4 sshPublicKey in LDAP but only see 2 in Gitea.

One thing I noticed is that 3 of those 4 keys I have in LDAP all start with the same list of characters, and the portion of the key shown by Gitea is the start of such "common substring". Maybe Gitea is just assuming the keys are EQUAL due to this shared initial string ? The keys are of ecdsa-sha2-nistp521 type and the first character outside the substring shown by Gitea is a b (not found before).

It would help if Gitea showed the whole key somehow, or at least the key comment at the end, to know what it's taking in consideration.

Gitea Version: 1.12.3

Originally created by @strk on GitHub (Mar 2, 2021). I'm still having trouble with public ssh keys synchronization from LDAP. I have added 4 sshPublicKey in LDAP but only see 2 in Gitea. One thing I noticed is that 3 of those 4 keys I have in LDAP all start with the same list of characters, and the portion of the key shown by Gitea is the start of such "common substring". Maybe Gitea is just assuming the keys are EQUAL due to this shared initial string ? The keys are of ecdsa-sha2-nistp521 type and the first character outside the substring shown by Gitea is a `b` (not found before). It would help if Gitea showed the whole key somehow, or at least the key comment at the end, to know what it's taking in consideration. Gitea Version: 1.12.3
GiteaMirror added the issue/duplicate label 2025-11-02 07:11:57 -06:00
Author
Owner

@strk commented on GitHub (Mar 2, 2021):

Sorry, I was misleaded by the need to logout/login again to see changes done in LDAP.
Now that I did I realize that with the given version of Gitea, only a SINGLE key is retrieved from LDAP when there are multiple ones.

Sounds like a revival of #13984 but I cannot find traces of the fix for that one in the CHANGELOG.md file. @zeripath any idea bout that ? Could you figure that out and add to CHANGELOG in the appropriate section ?

@strk commented on GitHub (Mar 2, 2021): Sorry, I was misleaded by the need to logout/login again to see changes done in LDAP. Now that I did I realize that with the given version of Gitea, only a SINGLE key is retrieved from LDAP when there are multiple ones. Sounds like a revival of #13984 but I cannot find traces of the fix for that one in the CHANGELOG.md file. @zeripath any idea bout that ? Could you figure that out and add to CHANGELOG in the appropriate section ?
Author
Owner

@strk commented on GitHub (Mar 2, 2021):

Logs from Gitea, about the "common substring":

2021/03/02 01:54:15 models/user.go:1746:addLdapSSHPublicKeys() [E] addLdapSSHPublicKeys[OSGeo LDAP]: Error adding LDAP Public SSH Key for user strk: public key already exists [owner_id: 2, name: OSGeo LDAP-ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTIt]

@strk commented on GitHub (Mar 2, 2021): Logs from Gitea, about the "common substring": > 2021/03/02 01:54:15 models/user.go:1746:addLdapSSHPublicKeys() [E] addLdapSSHPublicKeys[OSGeo LDAP]: Error adding LDAP Public SSH Key for user strk: public key already exists [owner_id: 2, name: OSGeo LDAP-ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTIt]
Author
Owner

@strk commented on GitHub (Mar 2, 2021):

Another problem (needs another ticket?) is that even if I enter a single key, ecdsa-sha2-nistp521 typed ssh key seems not supported (rsa works)

@strk commented on GitHub (Mar 2, 2021): Another problem (needs another ticket?) is that even if I enter a _single_ key, `ecdsa-sha2-nistp521` typed ssh key seems not supported (`rsa` works)
Author
Owner

@zeripath commented on GitHub (Mar 2, 2021):

Gitea Version: 1.12.3 <- do you mean 1.13.2 or 1.12.3?

@zeripath commented on GitHub (Mar 2, 2021): Gitea Version: 1.12.3 <- do you mean 1.13.2 or 1.12.3?
Author
Owner

@zeripath commented on GitHub (Mar 2, 2021):

#13989 and #14607 are not in a released version of Gitea yet and they won't go in to 1.12. #14607 will be in 1.13.3 when it is released.

Please re-test on release/v1.13 or master. I'm closing as duplicate please reopen if this remains true on release/v1.13 or v1.13.3 when it is released.

Duplicate #13984

@zeripath commented on GitHub (Mar 2, 2021): #13989 and #14607 are not in a released version of Gitea yet and they won't go in to 1.12. #14607 will be in 1.13.3 when it is released. Please re-test on release/v1.13 or master. I'm closing as duplicate please reopen if this remains true on release/v1.13 or v1.13.3 when it is released. Duplicate #13984
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6949