Add option to list public ssh keys #10471

Closed
opened 2025-11-02 09:08:19 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @cupcakearmy on GitHub (Mar 21, 2023).

Feature Description

It would be cool to have an option to list ssh keys as unauthenticated user.

Motivation

This makes it very handy to setup servers / remote machines.
Github has an endpoint for that (https://github.com/<username>.keys, in my case: https://github.com/cupcakearmy.keys).
They also offer a json verion of it https://api.github.com/users/cupcakearmy/keys.

In ubuntu for example there is the command ssh-import-id that also installs ssh-import-id-gh to automatically add them to your ~/.ssh/authorized_keys.

Otherwise you can manually:

wget -O - https://github.com/<username>.keys >> /home/myuser/.ssh/authorized_keys

Current state in Gitea

In Gitea there is such endpoint /users/{username}/keys, however it's behind authentication. In addition it returns a json object.

Feature Request

It would be nice to have an endpoint which you can publicly query and it returns your public keys in the same format required by authorized_keys.

Thanks for all the AMAZING work! If I can help let me know ❤️

Screenshots

No response

Originally created by @cupcakearmy on GitHub (Mar 21, 2023). ### Feature Description It would be cool to have an option to list ssh keys as unauthenticated user. **Motivation** This makes it very handy to setup servers / remote machines. Github has an endpoint for that (`https://github.com/<username>.keys`, in my case: https://github.com/cupcakearmy.keys). They also offer a json verion of it `https://api.github.com/users/cupcakearmy/keys`. In ubuntu for example there is the command `ssh-import-id` that also installs `ssh-import-id-gh` to automatically add them to your `~/.ssh/authorized_keys`. Otherwise you can [manually](https://askubuntu.com/a/1145195): ``` wget -O - https://github.com/<username>.keys >> /home/myuser/.ssh/authorized_keys ``` **Current state in Gitea** In Gitea there is such endpoint [`/users/{username}/keys`](https://try.gitea.io/api/swagger#/user/userListKeys), however it's behind authentication. In addition it returns a json object. **Feature Request** It would be nice to have an endpoint which you can publicly query and it returns your public keys in the same format required by `authorized_keys`. Thanks for all the AMAZING work! If I can help let me know ❤️ ### Screenshots _No response_
GiteaMirror added the type/proposaltype/feature labels 2025-11-02 09:08:19 -06:00
Author
Owner

@silverwind commented on GitHub (Mar 21, 2023):

https://github.com/.keys

This is already implemented.

@silverwind commented on GitHub (Mar 21, 2023): > https://github.com/<username>.keys This is [already implemented](https://try.gitea.io/silverwind.keys).
Author
Owner

@cupcakearmy commented on GitHub (Mar 21, 2023):

I am stupid xD Thanks and sorry for wasting your time :)

@cupcakearmy commented on GitHub (Mar 21, 2023): I am stupid xD Thanks and sorry for wasting your time :)
Author
Owner

@silverwind commented on GitHub (Mar 21, 2023):

Also, API seems there as well.

@silverwind commented on GitHub (Mar 21, 2023): Also, API [seems there as well](https://try.gitea.io/api/swagger#/user/userListKeys).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10471