Skip to content

Configuring an SSH port other than 22 disables START_SSH_SERVER #7361

Closed
@kalsan

Description

@kalsan
  • Gitea version (or commit ref): 1.9.0+dev-415-g49ee9d277
  • Git version: 2.20.1
  • Operating system: Debian/docker
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist: n/a

Description

Configuring an SSH port other than 22 disables START_SSH_SERVER. To reproduce, do:

  • Get the docker-compose.yml for the minimal installation as recommended by the Gitea docs
  • In the yml file, replace SSH port ("222:22") by 2222, i.e. sure the line reads "2222:2222" for the port forwarding
  • docker-compose up, then go to localhost:3000 to be welcomed by the Gitea installation wizard
  • Set the SSH port to 2222

Result: in app.ini, the option START_SSH_SERVER is omitted and thus, it is not possible to access Gittea via the proposed URL ssh://git@localhost:2222/user/repo.git as an attempt to do so will result in an exception "ssh_exchange_identification: Connection closed by remote host"

Expected result / how to fix: Adding the option START_SSH_SERVER = true to app.ini fixes the problem. The installer should do this even when the ssh port is not 22.

Note: Be sure to have a high enough port for trying this (e.g. when the port is set to 222, there is a permissions problem on Linux).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions