Debugged over Discord at https://discord.com/channels/1361963801993285692/1361963802848919676/1548074022833492135
In a situation when the user has multiple SSH keys enrolled with their SSH agent, knot2 falsely rejects pushes if the first offered SSH key does not match with any key that can be used to push to a repository. It should try all offered keys before rejecting the push.
This directly contradicts what the error message implies, which is that a) the knot knows which users can push and what keys they have, and b) all keys have been tested and none of them matches. Either the error message or the behavior has to be changed:
git: knot: this ssh key doesn't match any key published by the accounts that may push here. Authorized: @pluie.me. If your agent offers several keys, add -o IdentitiesOnly=yes so it offers your registered key.
This can be best demonstrated by the behavior of ssh -v git@tangled.org: (slightly edited)
git: debug1: Authentications that can continue: publickey
git: debug1: Next authentication method: publickey
git: debug1: get_agent_identities: agent returned 2 keys
git: debug1: Will attempt key: WRONG KEY ED25519 SHA256:xH4X1GvCECzu+HdrYotvo5VyZLbec5bX/H2x4NCddP0 agent
git: debug1: Will attempt key: correct key ED25519 SHA256:YtI1D7vlcZ4obaiJ4tQihtswcMhHKdfYZuc4whOX2y8 agent
git: debug1: Will attempt key: /home/leah/.ssh/id_rsa
git: debug1: Will attempt key: /home/leah/.ssh/id_ecdsa
git: debug1: Will attempt key: /home/leah/.ssh/id_ecdsa_sk
git: debug1: Will attempt key: /home/leah/.ssh/id_ed25519
git: debug1: Will attempt key: /home/leah/.ssh/id_ed25519_sk
git: debug1: Will attempt key: /home/leah/.ssh/id_mldsa44_ed25519
git: debug1: Offering public key: WRONG KEY ED25519 SHA256:xH4X1GvCECzu+HdrYotvo5VyZLbec5bX/H2x4NCddP0 agent
git: debug1: Server accepts key: WRONG KEY ED25519 SHA256:xH4X1GvCECzu+HdrYotvo5VyZLbec5bX/H2x4NCddP0 agent
git: Authenticated to tangled.org ([2a04:3541:1000:500:24de:d2ff:fe7c:749b]:22) using "publickey".
The offer sequence should look more like this (which matches old knot & GitHub behavior):
debug1: Offering public key: WRONG KEY ED25519 SHA256:xH4X1GvCECzu+HdrYotvo5VyZLbec5bX/H2x4NCddP0 agent
debug1: Authentications that can continue: publickey
debug1: Offering public key: correct key ED25519 SHA256:YtI1D7vlcZ4obaiJ4tQihtswcMhHKdfYZuc4whOX2y8 agent
debug1: Server accepts key: correct key ED25519 SHA256:YtI1D7vlcZ4obaiJ4tQihtswcMhHKdfYZuc4whOX2y8 agent
git: Authenticated to tangled.org ([2a04:3541:1000:500:24de:d2ff:fe7c:749b]:22) using "publickey".
Update: the correct key does get chosen when running
ssh -v pluie.me@tangled.org(replacepluie.mewith your Tangled username of course). So I assume the key-picking step is simply ignored with the Git user in particular.Update^2: Pushing to a git remote like
pluie.me@tangled.org:pluie.me/sitealso works, but IMO this looks really comical and it's not reasonable to expect everyone with multiple keys to change their remotes.