ssh port configuration not respected #10953

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

Originally created by @davama on GitHub (Jun 2, 2023).

Description

When setting the below config in gitea/conf/app.ini

SSH_PORT          = 2222
SSH_LISTEN_PORT   = 2222

gitea still wants to bind to port 22. I've tried different combinations of the above with 22 and 2222 but still get a bind to port 22 regardless of my configuration.

Want's even more interesting is that on the UI, it shows 2222. (See screenshot below)

What could be the issue?

Thank you,
Dave

Gitea Version

1.19.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://pastebin.com/raw/t9xeRmsD

Screenshots

image

Git Version

2.39.3

Operating System

Rocky Linux 9

How are you running Gitea?

gitea is running on docker with the key network_mode: host and using the gitea/gitea:latest tag.

Because gitea docker wants to bind to 22, it conflicts with the local ssh server of the host on port 22.

Why not using a docker network?
to match all our other docker deployments. also docker does not behave consistently with ipv6, which we use, hence using network_mode: host

Database

PostgreSQL

Originally created by @davama on GitHub (Jun 2, 2023). ### Description When setting the below config in `gitea/conf/app.ini` ``` SSH_PORT = 2222 SSH_LISTEN_PORT = 2222 ``` gitea still wants to bind to port `22`. I've tried different combinations of the above with `22` and `2222` but still get a bind to port `22` regardless of my configuration. Want's even more interesting is that on the UI, it shows `2222`. (See screenshot below) What could be the issue? Thank you, Dave ### Gitea Version 1.19.3 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist https://pastebin.com/raw/t9xeRmsD ### Screenshots ![image](https://i.imgur.com/cjwXYiN.png) ### Git Version 2.39.3 ### Operating System Rocky Linux 9 ### How are you running Gitea? gitea is running on docker with the key `network_mode: host` and using the `gitea/gitea:latest` tag. Because gitea docker wants to bind to `22`, it conflicts with the local ssh server of the host on port `22`. Why not using a docker network? to match all our other docker deployments. also docker does not behave consistently with ipv6, which we use, hence using `network_mode: host` ### Database PostgreSQL
GiteaMirror added the type/question label 2025-11-02 09:23:07 -06:00
Author
Owner

@techknowlogick commented on GitHub (Jun 2, 2023):

In the rootful docker image it is opensshd that attempts to bind to port 22. If you use the rootless docker image then it doesn't include opensshd.

@techknowlogick commented on GitHub (Jun 2, 2023): In the rootful docker image it is opensshd that attempts to bind to port 22. If you use the rootless docker image then it doesn't include opensshd.
Author
Owner

@davama commented on GitHub (Jun 2, 2023):

@techknowlogick

thank you for the quick response

but we use ssh to do any git related work. (DISABLE_HTTP_GIT=true )

Will this hinder that?

@davama commented on GitHub (Jun 2, 2023): @techknowlogick thank you for the quick response but we use ssh to do any git related work. (`DISABLE_HTTP_GIT=true` ) Will this hinder that?
Author
Owner

@techknowlogick commented on GitHub (Jun 2, 2023):

Gitea has a built-in SSH server which is an alternative to opensshd, which is what the configuration values you were changing affected.

@techknowlogick commented on GitHub (Jun 2, 2023): Gitea has a built-in SSH server which is an alternative to opensshd, which is what the configuration values you were changing affected.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10953