Skip to content

ssh: support multiple builtin SSH server listener #27969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mswart
Copy link

@mswart mswart commented Nov 8, 2023

Optimized for setups that prevent uses of global listeners (like 0.0.0.0) but still want to serve via multiple addresses. This could be listening on both a IPv4 and IPv6 address while another SSH server is used for server administration.

Fixes #12418


I decided to keep the change minimilistic (e.g. don't rename/deprecate the config option; no new integration test). I am happy to adapt the PR if another approach is recommended.

Optimized for setups that prevent uses of global listeners
(like 0.0.0.0) but still want to serve via multiple addresses.
This could be listening on both a IPv4 and IPv6 address while
another SSH server is used for server administration.

Fixes go-gitea#12418
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 8, 2023
@techknowlogick techknowlogick added the type/enhancement An improvement of existing functionality label Nov 9, 2023
@lunny lunny added this to the 1.22.0 milestone Nov 9, 2023
@6543
Copy link
Member

6543 commented Nov 9, 2023

I wonder if it would be better to be able to set the socket -> 1.2.3.4:22, 3.11.2.3:2200, ...

and only use the ssh_port setting as default port if not set (so in UI ssh_port is used, but you can make gitea listen to any ip/port connections)

The documented default value was previously not encoded by just was
the system would do on an empty string.
Support listening on multiple address with different ports by
overridding the default SSH_LISTEN_ADDRESS like `0.0.0.0,127.0.0.1:2022,[::1]:222,::`
@lunny lunny modified the milestones: 1.22.0, 1.23.0 Mar 29, 2024
@lunny
Copy link
Member

lunny commented Sep 20, 2024

I think this is easy to implement with an extra port forward tool.

@lunny lunny modified the milestones: 1.23.0, 1.24.0 Sep 20, 2024
@lunny lunny removed this from the 1.24.0 milestone Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/docs type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSH_LISTEN_HOST accepts only one address
5 participants