We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Cloud Infrastructure
Free preview: the first 2 parts of this 6-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Cloud Infrastructure
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
Your database server sits in a private subnet. No public IP. No Internet Gateway route. This is exactly right, but now you need to run a migration, check logs, or troubleshoot an issue. You cannot SSH in because the server is unreachable from the internet.
A bastion host (also called a jump box) solves this. It is a single, hardened server in a public subnet that acts as the gateway to your private infrastructure. You SSH into the bastion, then from the bastion, you SSH into private servers. The bastion is the only server exposed to the internet on SSH port 22.
Why not just make each private server temporarily public when you need access? Because every public IP is an attack surface. Every exposed SSH port is a target for brute-force bots. Cloudflare's 2023 SSH threat report found that the average public-facing SSH server receives 13,000 unauthorized login attempts per day. A single bastion with strict security groups, audit logging, and MFA provides a controlled, auditable chokepoint for all administrative access.
The access chain:
Developer laptop -> SSH -> Bastion (public subnet) -> SSH -> Private server
Security hardening checklist:
Cost optimization: Do not run a bastion 24/7. Use an on-demand bastion: start it when needed, stop it after. Or better, use AWS Systems Manager Session Manager, which provides shell access to private instances without any bastion at all (no SSH port exposure, no public IP needed, full audit trail).
| Approach | Security | Cost | Convenience |
|---|---|---|---|
| Always-on bastion | Moderate | ~$8/month (t3.micro) | High |
| On-demand bastion | Better (less exposure) | ~$2/month | Medium |
| SSM Session Manager | Best (no exposed ports) | Free (with SSM agent) | Medium |
| Teleport | Best (identity-based, recorded) | $0-300/month | High |