Allow custom SSH user in UI for built-in SSH server. #1102

Closed
opened 2025-11-02 03:48:48 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @pgaskin on GitHub (Sep 27, 2017).

The built-in SSH server is useful, especially for testing. The biggest disadvantage is that the user shown in the UI for the built-in SSH server is set to whatever the RUN_USER is set to, which must be the user Gitea is started as.

Because the built-in SSH server only uses the public-key to authenticate, I can use any user when cloning the repository.

In my opinion, there should be a config option to set a custom user to display in the UI in the SSH clone URL when the built-in SSH server is enabled. There could also be an option to omit the user entirely, because any user will work, as long as the SSH key is registered in the user's settings.

Originally created by @pgaskin on GitHub (Sep 27, 2017). The built-in SSH server is useful, especially for testing. The biggest disadvantage is that the user shown in the UI for the built-in SSH server is set to whatever the `RUN_USER` is set to, which must be the user Gitea is started as. Because the built-in SSH server [only uses the public-key to authenticate](https://github.com/go-gitea/gitea/blob/master/modules/ssh/ssh.go#L155-L164), I can use any user when cloning the repository. In my opinion, there should be a config option to set a custom user to display in the UI in the SSH clone URL when the built-in SSH server is enabled. There could also be an option to omit the user entirely, because any user will work, as long as the SSH key is registered in the user's settings.
GiteaMirror added the type/enhancement label 2025-11-02 03:48:48 -06:00
Author
Owner

@pgaskin commented on GitHub (Sep 27, 2017):

I may work on this if I have time, which I have been quite short on recently.

Related file: https://github.com/go-gitea/gitea/blob/master/models/repo.go#L818-L823

@pgaskin commented on GitHub (Sep 27, 2017): I may work on this if I have time, which I have been quite short on recently. Related file: https://github.com/go-gitea/gitea/blob/master/models/repo.go#L818-L823
Author
Owner

@pgaskin commented on GitHub (Oct 8, 2017):

I am working on this now.

@pgaskin commented on GitHub (Oct 8, 2017): I am working on this now.
Author
Owner

@pgaskin commented on GitHub (Oct 8, 2017):

I have submitted a PR.

@pgaskin commented on GitHub (Oct 8, 2017): I have submitted a PR.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1102