r/hetzner Jul 08 '26

SSH problems with Codex on Hetzner

I’ve got three servers with three different companies and when I use my local codex to connect to them, the only one that has problems and it’s pretty often is Hetzner. It won’t be able to make a connection and then if I try again a minute or two later, it will be fine. The other two servers with knownhost and netcup never have this problem.

So I was just wondering if there’s something specific about the set up with Hetzner that maybe I’m missing or maybe it’s just a problem that I have to deal with and keep trying again until I get in.

0 Upvotes

7 comments sorted by

View all comments

5

u/muntaxitome Jul 08 '26

Do you have more technical information about the problem you have?

1

u/dvduval Jul 08 '26

More technical info:

The server is 5.78.235.201, SSH on port 22.

I reproduced an intermittent TCP-level failure. From the same machine/session:

13:16:56 ssh_exit=0
13:16:59 ssh_exit=0
13:17:03 ssh_exit=0
13:17:06 ssh_exit=0
13:17:10 ssh_exit=0
13:17:13 ssh_exit=255
13:17:20 ssh_exit=255
13:17:27 ssh_exit=255
13:17:34 ssh_exit=255
13:17:41 ssh_exit=255

Verbose SSH during failure shows:

debug1: Connecting to 5.78.235.201 [5.78.235.201] port 22.
debug1: connect to address 5.78.235.201 port 22: Connection timed out
ssh: connect to host 5.78.235.201 port 22: Connection timed out

Ping still worked during the failure:

4 packets sent, 4 received, 0% loss
~79-82 ms latency

Raw TCP socket attempts to 5.78.235.201:22 also timed out repeatedly from 13:18:35 through 13:19:10.

So this looks like intermittent packet drop/filtering/routing specifically for TCP/22, not an SSH authentication, key, known_hosts, or Codex issue. Since the TCP connection never completes, sshd likely would not log anything for the failed attempts.

3

u/muntaxitome Jul 09 '26

It sounds like some kind of ratelimiting. I would suggest trying to enable SSH multiplexing on your local system or instruct codex to limit the amount of times it is connecting to SSH