Home/Refreshers/Shell access without opening a port: refresher
Shell access without opening a port
Reach a server for troubleshooting with nothing listening on the internet, and a recording of the session.
Remember
- You ask for a shell: from the command line.
- The broker checks who you are: the server has no open port.
- The session runs through the broker: on an encrypted channel.
- A transcript is saved: somewhere you can audit it.
| Platform | Uses | The part that catches people |
|---|---|---|
| AWS | SSM Session Manager logging to S3 and CloudWatch | The preferences live in one document per account and region, named SSM-SessionManagerRunShell. |
| Azure | Azure Bastion, with every connection recorded | Bastion needs a subnet named AzureBastionSubnet, /26 or larger. |
| Google Cloud | Identity-Aware Proxy TCP forwarding with audit logs | IAP records who opened a tunnel, to which VM and port, and when. |
| Oracle Cloud | OCI Bastion with managed SSH sessions | Bastion does not record what is typed. |
Run the quick start
| Download providers | terraform init |
| Preview | terraform plan |
| Apply | terraform apply |
Watch out
- Nothing listens on the internet.
- Every session is tied to a cloud identity, so access ends when that identity is disabled, with no SSH keys left behind on the machines.
Check it worked
Open a session. Confirm there is no inbound rule and the transcript was saved.