Tried to deply gogs/gogs git service and got sshd:22 already in use and error: kex_exchange_identification: Connection closed by remote host

I tried to run gogs/gogs.
Took reference of Gogs (standalone git service) as a Fly example and following stuffs in it.
Now, while deploying I saw error saying:
error: Bind to port 22 on :: failed: Address in use
followed by a stream of ongoing:

Not sure of whats wrong in sshd.

Hi there! Fly runs a tiny SSH server on each of your VMs, which allows you to use flyctl ssh to access them. It binds to port 22 on the VM’s 6PN address, so sshd consequently can’t bind to :: (all IPv6 addresses). Is it possible to change the internal port that Gogs’s sshd listens on (and update internal_port in your fly.toml to match)?

Regarding the ongoing “connection closed” errors, I think that this is Fly’s proxy performing health checks on sshd over IPv4. This is what is configured by the services.tcp_checks block in the guide that you linked. Assuming that you’ve configured the interval to be 10000 as in the guide, the proxy connects to sshd every 10 seconds to check that it’s alive. AFAIK, it closes the connection as soon as it has verified this—it doesn’t send any data—and as a result sshd prints a message to complain. So in this case, I don’t think it’s indicative of a problem.

Hi. Thanks for the detailed reply. It helped me to figure out whats wrong. That output is not t be cared for the scope of application.
Thanks again!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.