Allow sharing one SSH key between multiple accounts #9552

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

Originally created by @forestbeasts on GitHub (Sep 11, 2022).

Feature Description

So, we're plural (multiple people living in the same body). We've got multiple accounts on our own personal gitea server, one per person who's bothered to set one up.

This is great! ... except when we go to add SSH keys.

Gitea apparently rejects a SSH key if it's already been added to another account. This means that we have to use a separate key for each account, which wouldn't be that big of a deal except it means we need to configure SSH to send a different key for each account. So we have to use things like "git@giteadomain-user:user/repo", and we end up with a SSH hosts file that has a bunch of "giteadomain-user" fake hosts in it.

Allowing one key on multiple accounts wouldn't be a security issue, I don't think: the accounts all belong to us anyway. So, how about letting us share a SSH key?

-- Frost

Screenshots

No response

Originally created by @forestbeasts on GitHub (Sep 11, 2022). ### Feature Description So, we're plural (multiple people living in the same body). We've got multiple accounts on our own personal gitea server, one per person who's bothered to set one up. This is great! ... except when we go to add SSH keys. Gitea apparently rejects a SSH key if it's already been added to another account. This means that we have to use a separate key for each account, which wouldn't be that big of a deal except it means we need to configure SSH to _send_ a different key for each account. So we have to use things like "git@giteadomain-user:user/repo", and we end up with a SSH hosts file that has a bunch of "giteadomain-user" fake hosts in it. Allowing one key on multiple accounts wouldn't be a security issue, I don't think: the accounts all belong to us anyway. So, how about letting us share a SSH key? -- Frost ### Screenshots _No response_
GiteaMirror added the type/proposalissue/needs-feedback labels 2025-11-02 08:42:44 -06:00
Author
Owner

@forestbeasts commented on GitHub (Sep 11, 2022):

... okay update: apparently SSH lets you put in multiple keys and it tries them all! That helps IMMENSELY, making this much less big of a deal.

(It'd still be nice not to have to make tons of keys though, of course.)

@forestbeasts commented on GitHub (Sep 11, 2022): ... okay update: apparently SSH lets you put in multiple keys and it tries them all! That helps IMMENSELY, making this much less big of a deal. (It'd still be nice not to have to make tons of keys though, of course.)
Author
Owner

@lunny commented on GitHub (Sep 12, 2022):

But how do you know which user should be login when push with that SSH private key?

@lunny commented on GitHub (Sep 12, 2022): But how do you know which user should be login when push with that SSH private key?
Author
Owner

@wxiaoguang commented on GitHub (Sep 28, 2022):

A SSH key can be only used for one account. Otherwise if someone does "git push git@gitea.host", the Gitea server can not know what the user is for the key.

@wxiaoguang commented on GitHub (Sep 28, 2022): A SSH key can be only used for one account. Otherwise if someone does "git push git@gitea.host", the Gitea server can not know what the user is for the key.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9552