morpheuskafka 8 minutes ago

They are saying they want to directly SSH into a VM/container based on the web hostname it serves. But that's not how the HTTP traffic flows either. With only one routable IP for the host, all traffic on a port shared by VMs has to go to a server on the host first (unless you route based on port or source IP with iptnbles, but that is not hostname based).

The HTTP traffic goes to a server (a reverse proxy, say nginx) on the host, which then reads it and proxies it to the correct VM. The client can't ever send TCP packets directly to the VM, HTTP or otherwise. That doesn't just magically happen because HTTP has a Host header, only because nginx is on the host.

What they want is a reverse proxy for SSH, and doesn't SSH already have that via jump/bastion hosts? I feel like this could be implement with a shell alias, so that:

ssh user@vm1.box1.tld becomes: ssh -j jumpusr@box1.tld user@vm1

And just make jumpusr have no host permissions and shell set to only allow ssh.

krautsauer 8 minutes ago

SSH waits for the server key before it presents the client keys, right? Does this mean that different VMs from different users have the same key? (Or rather, all VMs have the same key? A quick look shows s00{1,2,3}.exe.xyz all having the same key.) So this is full MitM?

dlenski 26 minutes ago

SSH is an incredibly versatile and useful tool, but many things about the protocol are poorly designed, including its essentially made-up-as-you-go-along wire formats for authentication negotiation, key exchange, etc.

In 2024-2025, I did a survey of millions of public keys on the Internet, gathered from SSH servers and users in addition to TLS hosts, and discovered—among other problems—that it's incredibly easy to misuse SSH keys in large part because they're stored "bare" rather than encapsulated into a certificate format that can provide some guidance as to how they should be used and for what purposes they should be trusted:

https://cryptographycaffe.sandboxaq.com/posts/survey-public-....

  • Charon77 11 minutes ago

    What good does certificate format do? Certainly won't make people not reuse it the same way.

    > where the affected users might be surprised or alarmed to learn that it is possible to link these real-world identities.

    I feel like it's obvious that ssh public keys publically identifies me, and if I don't want that, I can make different keys for different sites.

3r7j6qzi9jvnve 13 minutes ago

I wonder if it's something like https://github.com/cea-hpc/sshproxy that sits in the middle (with decryption and everything) or if they could do this without setting up a session directly with the client.

Well, we're implicitly trusting the host when running a VM anyway (most of the time), but it's something I'd want to check before buying into the service.

EDIT: Ah, it's probably https://github.com/boldsoftware/sshpiper

will try to remember to look later.

  • kro 7 minutes ago

    Almost certainly it does, as public key auth takes place after setting up the session encryption

otterley 9 minutes ago

This is admittedly a clever trick, but I can’t help but wonder where it breaks. There seems to be an invariant that the number of backends a public key is mapped to cannot exceed the number of proxy IPs available. The scheme probably works fine if most people are only using a small number of instances, though.

Eikon 27 minutes ago

I am not sure to understand what this is this achieving compared to just assigning a ip + port per vm?

  • CGamesPlay 18 minutes ago

    Using nonstandard ports would break the `ssh foo.exe.dev` pattern.

    This could also have been solved by requiring users to customize their SSH config (coder does this once per machine, and it applies to all workspaces), but I guess the exe.dev guys are going for a "zero-config, works anywhere" experience.

    • w-ll 11 minutes ago

      -p ?

  • otterley 18 minutes ago

    Not needing a different port. Middleboxes often block ssh on nonstandard ports. Also, to preserve the alignment between the SSH hostname and the web service hostname, as though the user was accessing a single host at a single public address. Usability is key for them.

    • Dylan16807 4 minutes ago

      Why would anyone configure it to do that?

      Like, I understand the really restrictive ones that only allow web browsing. But why allow outgoing ssh to port 22 but not other ports? Especially when port 22 is arguably the least secure option. At that point let people connect to any port except for a small blacklist.

      • otterley a minute ago

        I’m not a network security expert, so I don’t know the threat model. I just know that this is a thing companies do sometimes.

    • Charon77 17 minutes ago

      They don't want each vm to have different public IP

    • gsich 6 minutes ago

      Middleboxes are not relevant in this scenario.

      • otterley 5 minutes ago

        Uh, why not? Unless your SSH client is on the same network as theirs, there are going to be middleboxes somewhere in the path.