frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

SSH has no Host header

https://blog.exe.dev/ssh-host-header
74•apitman•2h ago

Comments

Eikon•1h ago
I am not sure to understand what this is this achieving compared to just assigning a ip + port per vm?
otterley•1h ago
Not needing a different port. Middleboxes sometimes 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.
Charon77•1h ago
They don't want each vm to have different public IP
gsich•1h ago
Middleboxes are not relevant in this scenario.
otterley•1h 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.
Dylan16807•1h 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•1h 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.
josephcsible•1h ago
Middlebox operators aren't known for making reasonable or logical decisions.
9dev•37m ago
Asking back, when I limit the outgoing connections from a network, why would I account for any nonstandard port and make the ruleset unwieldy, just in case someone wanted to do something clever?
Dylan16807•14m ago
A simple ruleset would only block a couple dangerous ports and leave everything else connectable. Whitelisting outgoing destination ports is more complicated and more annoying to deal with for no benefit. The only place you should be whitelisting destination ports is when you're looking at incoming connections.
CGamesPlay•1h 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•1h ago
-p ?
hrmtst93837•15m ago
Zero-config usually means the complexity got shoved somewhere less visible. An SSH config is fine for one box, but with a pile of ephemeral workspaces it turns into stale cruft fast and half the entries is for hosts you forgot existed.

The port issue is also boringly practical. A lot of corp envs treat 22 as blessed and anything else as a ticket, so baking the routing into the name is ugly but I can see why they picked it, even if the protocool should have had a target name from day one.

dlenski•1h 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•1h 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.

bauruine•1h ago
ssh by default sends all your public keys to a server. Yes you can limit some keys to specific hosts but it's very easy to dox yourself.
ulrikrasmussen•43m ago
I had never thought about that. Seems like an easy problem to fix by sending salted hashes instead.
grey-area•17m ago
Doesn’t it try one key at a time rather than send all?
dotwaffle•1h ago
That's the point, though. An SSH key gives authentication, not authorization. Generally a certificate is a key signed by some other mutually trusted authority, which SSH explicitly tried to avoid.
3r7j6qzi9jvnve•1h 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•1h ago
Almost certainly it does, as public key auth takes place after setting up the session encryption
otterley•1h ago
This is 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. I assume this is in fact the case.

Another thing that just crossed my mind is that the proxy IP cannot be reassigned without the client popping up a warning. That may alarm security-conscious users and impact usability.

cortesoft•1h ago
They just need to set the limit on the number of VMs per user to be less than or equal to the number of public IPs they have available. As long as two users don't try to share a key, you are good... which should be easy, just don't let them upload a key that another user has already uploaded.
ulrikrasmussen•41m ago
I also wonder what happens if you want to grant access to your VM to additional public keys and one of those public keys happen to already be routed to a different VM on the same IP.
krautsauer•1h 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?
cortesoft•1h ago
I mean, anytime you use the cloud for anything, you are giving MITM capabilities to the hosting provider. It is their hardware, their hypervisors... they can access anything inside the VMs
yaur•45m ago
This approach doesn't give access from the hypervisor to your private keys it gives access to other tenants to your private keys.
TZubiri•40m ago
I think the vulnerability would be that not only the host can now MITM, but other co-tenants would have the capability to bypass that MiTM protection.
morpheuskafka•1h 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.

Dylan16807•1h ago
If jump host shell aliases were a valid option, then setting a port would be a much easier valid option.
lmm•1h ago
The point is that they want the simple UX of "ssh vm1.box1.tld" takes you to the same machine that browsing to vm1.box1.tld takes you to, without requiring their users to set any additional configuration.
TZubiri•45m 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.

> Proceeds to explain how the HTTP traffic flows based on the hostname.

If you wanted to flex on your knowledge of the subject you could have just lead the whole explanation with

>"I know all about this, here's how it works."

Also

>"What they want is a reverse proxy for SSH"

They already did this, I'm much more impressed by the original article that actually implemented it than by your comment "correcting them" and suggesting a solution.

miyuru•1h ago
> We cannot issue an IPv4 address to each machine without blowing out the cost of the subscription. We cannot use IPv6-only as that means some of the internet cannot reach the VM over the web. That means we have to share IPv4 addresses between VMs.

Give a user a option for use IPv6 only, and if the user need legacy IP add it as a additional cost and move on.

Trying to keep v4 at the same cost level as v6 is not a thing we can solve. If it was we wouldn't need v6.

YesThatTom2•1h ago
This is the way.
TZubiri•47m ago
Op solved a problem and your comment is "I wouldn't have solved the problem".

>legacy IP

lol

9dev•41m ago
It's a nice solution for sure, but a problem by choice. You could just have an AAAA record for the domain in addition to the A record, and as GP pointed out, resolve SSH sessions via the IPv6. If the user wants SSH to work with IPv4 for whatever reason—I see the point that there may be some web visitors without IPv6 still, but devs?—they could pay a small extra for a dedicated IPv4 address.
asmor•17m ago
This is great if you have IPv6 support from your ISP. Not so great if you don't.

Before someone mentions tunnels: Last time I tried to set up a tunnel Happy Eyeballs didn't work for me at all; almost everything went through the tunnel anyway and I had to deal with non-residential IP space issues and way too much traffic.

c45y•1h ago
I would love it if more systems just understood SRV records, hostname.xyz = 10.1.1.1:2222

So far it feels like only LDAP really makes use of it, at least with the tech I interact with

iwontberude•58m ago
I love that kubernetes does this for cluster service domain names
jiehong•52m ago
It’s also similar with mDNS on local networks. It’s actually nice!

Overall, DNS features are not always well implemented on most software stack.

A basic example is the fact that DNS resolution actually returns a list of IPs, and the client should be trying them sequentially or in parallel, so that one can be down without impact and annoying TTL propagation issues. Yet, many languages have a std lib giving you back a single IP, or a http client assuming only one, the first.

XorNot•58m ago
The solution to this is TLS SNI redirecting.

You can front a TLS server on port 443 and then redirect without decrypting the connection based on the SNI name to your final destination host.

J-Kuhn•54m ago
But... this doesn't work for SSH, which is the problem here?
XorNot•35m ago
SSH has ProxyCommand which accepts the %h template.

Provided your users will configure something a little - or you provide a wrapping command - you can setup the tunneling for them.

binarin•52m ago
In kinda the same situation, I was using username for host routing. And real user was determined by the principal in SSH certificate - so the proxy didn't even need to know the concrete certificates for users; it was even easier than keeping track of user SSH keys.

Certificate signing was done by a separate SSH service, which you connected too with enabled SSH agent forwarding, pass 2FA challenge, and get a signed cert injected into your agent.

charcircuit•52m ago
You don't need SSH. Installing an SSH server to such a VM is a hold over from how UNIX servers worked. It puts you in the mindset of treating your server as a pet and doing things for a single vm instead of having proper server management in place. I would reconsider if offering ssh is an actual requirement here or if it could be better served by offering users a proper control panel to manage and monitor the vms.
mystifyingpoi•24m ago
Could you suggest an alternative then? Something that is feature complete with SSH server, and also free.
charcircuit•12m ago
I have not worked in the server management in many years, but with how cheap code is with AI rolling your own dashboard may not be such a bad idea.

>with SSH server

My comment was about how you do not need an ssh server. The idea of a server exposing a command line that allows potentially anything to be done is not necessary in order to manage and monitor a server.

thaumaturgy•48m ago
Yeah, I ran into this problem too. I tried a few different hacky solutions and then settled on using port knocking to sort inbound ssh connections into their intended destinations. Works great.

I have an architecture with a single IP hosting multiple LXC containers. I wanted users to be able to ssh into their containers as you would for any other environment. There's an option in sshd that allows you to run a script during a connection request so you can almost juggle connections according to the username -- if I remember right, it's been several years since I tried that -- but it's terribly fragile and tends to not pass TTYs properly and basically everything hates it.

But, set up knockd, and then generate a random knock sequence for each individual user and automatically update your knockd config with that, and each knock sequence then (temporarily) adds a nat rule that connects the user to their destination container.

When adding ssh users, I also provide them with a client config file that includes the ProxyCommand incantation that makes it work on their end.

Been using this for a few years and no problems so far.

snvzz•47m ago
The solution is ipv6.
TZubiri•43m ago
It's hard to think of a clearer example for the concept of Developer Experience.

One similar example of SSH related UX design is Github. We mostly take the git clone git@github.com/author/repo for granted, as if it were a standard git thing that existed before. But if you ever go broke and have to implement GitHub from scratch, you'll notice the beauty in its design.

ulrikrasmussen•38m ago
Wouldn't a much simpler approach be to have everyone log in to a common server which sits on a VPN with all the VMs? It introduces an extra hop, but this is a pretty minor inconvenience and can be scripted away.

Show HN: Lumbox – Email infrastructure for AI agents (lumbox.co)

1•kumardeepanshu•20s ago•0 comments

Ask HN: Burning $100K/week on LLM tokens – what are you doing to cut costs?

1•seenkitty•1m ago•0 comments

Show HN: ShadowStrike – Windows EDR Post-Analysis

1•Soocile•1m ago•0 comments

How the Open-Source Community Is Bypassing OS Age Verification Laws

https://thecybersecguru.com/glossary/bypass-os-age-verification-laws/
8•lesterrue•6m ago•0 comments

Google Flood Forecasting API

https://developers.google.com/flood-forecasting
1•teleforce•10m ago•0 comments

Just create a free bio generator

https://www.aibiotools.com/
2•JohnYuan97•13m ago•1 comments

Built an AI course that teaches to make 3-5k monthly -Launching Today

https://bpyynqq0ziax.space.minimax.io/
3•AIMoneyMachine•15m ago•2 comments

PHP 8.4.19 Release Announcement

https://www.php.net/releases/8_4_19.php
2•ms7892•16m ago•0 comments

Animation 10k Starlink Satellites

https://spaceweather.com/archive.php?view=1&day=18&month=03&year=2026
2•MeteorMarc•17m ago•0 comments

Catastrophe and Corporate Bonds: A Unified Approach to Pricing Disaster Risks

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6165466
2•7777777phil•17m ago•0 comments

Show HN: Blocktools – a Rust-powered suite for the smart contract lifecycle

https://blocktools.dev
2•wazzaaaa•18m ago•0 comments

Show HN: QCCBot – Android in a browser tab, with AI agent control

4•Eastra•18m ago•0 comments

Show HN: ROMA runs multiple coding agents simultaneously – Claude, Codex, etc.

https://github.com/liliang-cn/roma
2•AISlop31415•20m ago•0 comments

Confer is bringing foundational AI privacy to Meta

https://confer.to/blog/2026/03/encrypted-meta/
2•jbegley•22m ago•0 comments

Echoo – Free, open-source macOS app for system-wide AI via shortcuts and voice

https://www.echoo.ai/
2•mike_elkabetz•23m ago•2 comments

Run any LLM on any hardware. Auto-detects your GPU, checks if the model fits

https://github.com/Julienbase/uniinfer
2•julien_base31•25m ago•0 comments

AI changed software cost structure not Value structure

https://testdouble.com/insights/quality-you-cant-generate-ai-is-only-as-good-as-your-constraints
2•kathir05•30m ago•0 comments

Arizona Charges Kalshi with Illegal Gambling Operation

https://www.bloomberg.com/news/articles/2026-03-17/arizona-charges-kalshi-with-operating-illegal-...
3•greg_w•38m ago•0 comments

Show HN: Open-source YouTube summary, transcript chat, and timeline sidepanel

https://github.com/EchoTide/QuickSummarize
2•oujiangping•41m ago•0 comments

British physics faces 'catastrophic' cuts

https://www.bbc.com/news/articles/czr0zmzzp84o
3•jb1991•41m ago•0 comments

Show HN: Vue-OTP-pro – Minimal OTP input for Vue 3

https://vue-otp-pro.netlify.app
2•pratik227•44m ago•0 comments

Celebrating Tony Hoare's mark on computer science

https://bertrandmeyer.com/2026/03/16/celebrating-tony-hoares-mark-on-computer-science/
2•benhoyt•49m ago•0 comments

The Hyperscale IPv4 Moat: Analyzing AWS's Latest 9M Address Acquisition

https://circleid.com/posts/the-hyperscale-ipv4-moat-analyzing-awss-latest-9m-address-acquisition
2•jruohonen•50m ago•0 comments

The Last Quiet Thing

https://www.terrygodier.com/the-last-quiet-thing
5•cylo•54m ago•1 comments

CVE-2025-71263: Unix fourth edition buffer overflow vulnerability

https://www.cve.org/CVERecord?id=CVE-2025-71263
3•pseudohadamard•54m ago•1 comments

The End of Political Hypocrisy

https://hedgehogreview.com/web-features/thr/posts/the-end-of-political-hypocrisy
5•rzk•55m ago•1 comments

Show HN: I wrote a macOS C++ audio driver to fix HDMI volume controls

https://github.com/chenjy16/SoundBridge
3•chenjy16•56m ago•0 comments

Contract-Centered Iterative Stability v4.7.3

https://ai.gtzilla.com/papers/contract-centered-iterative-stability-v4.7.3/
2•osconfused•58m ago•1 comments

DeepSeek by Hand in Excel

https://www.byhand.ai/p/deepseek-lecture-128
5•teleforce•59m ago•0 comments

Thrum – Agent coordination through messaging

https://leonletto.github.io/thrum/index.html
3•leonletto•1h ago•1 comments