The Simplest Way to Make Ec2 Systems Manager and Ubuntu Work Like They Should
Using ec2 systems manager and ubuntu lets teams run Linux servers without open SSH ports. An agent on the server talks to the cloud control plane over secure outbound traffic. This setup removes the need for public IP addresses on your host machines. Engineers log in through cloud roles instead of sharing static SSH keys across the team. You can run shell commands, apply OS patches, and read logs from one central place. How ec2 systems manager and ubuntu handle roles and traffic The workflow
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Using ec2 systems manager and ubuntu lets teams run Linux servers without open SSH ports. An agent on the server talks to the cloud control plane over secure outbound traffic.
This setup removes the need for public IP addresses on your host machines. Engineers log in through cloud roles instead of sharing static SSH keys across the team. You can run shell commands, apply OS patches, and read logs from one central place.
How ec2 systems manager and ubuntu handle roles and traffic
The workflow starts with the background agent installed on your Linux server image. Recent official cloud images include this agent by default through the snap package system. When the server boots, the agent wakes up and checks for an instance profile.
That profile holds a cloud role with specific rules for server management. The agent uses temporary keys from the local metadata service to prove its identity. Then it opens an outbound HTTPS link to the regional management endpoint.
All traffic flows out from the server to the cloud API over the configured port. You never need to open inbound ports in your firewall or security group rules. When an engineer starts a shell session, the control plane sends messages down that link.
The agent reads the messages, runs the local shell, and sends the output back. Cloud policies decide which users can start sessions on which tagged host machines. Local OS users still matter because the agent maps sessions to a local Linux account.
Common failure modes and how to scope permissions
Several common mistakes break this setup or leave big security gaps in production. First, teams attach overly broad cloud roles to the host instance profile. If a server role has full admin rights, any person on that box gains them.
GCP Access Context Manager + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Second, by default, the agent drops every user into the same shared Linux account. That account often has full root rights without a password prompt. When five engineers share one local user, local system logs cannot show who ran what.
Third, teams forget to turn on output logging for interactive shell commands. Without log delivery to cloud storage, you only see when a session started. You miss the exact commands the user typed inside the Linux shell.
Another common issue happens in private subnets that lack a route to the internet. If the Ubuntu server cannot reach the regional API, the agent stays offline. You must set up private VPC endpoints for the management service inside your network.
To fix permissions, give the host instance role only the minimum required management policy. Map cloud user tags to separate local OS accounts to keep user actions distinct. Turn on command logging and send all output to an encrypted storage bucket.
Also watch out for data leaks in command output logs. When engineers query databases or inspect files, raw emails or card numbers can appear. Data masking rewrites matched fields in results so sensitive strings stay out of shared logs.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Why does my Ubuntu server not show up in the fleet list?
Check three things on the host machine first. Make sure the snap agent service is running, an instance role is attached, and outbound the configured port reaches the regional endpoint.
Do I need to open the configured port for this setup to work?
No, you can close the configured port in your security group rules. The local agent uses outbound HTTPS traffic to connect back to the cloud service.
How do we restrict root commands during a shell session?
Set up your session rules to use a standard Linux user instead of the default admin account. Then manage sudo rights on the OS with standard Linux group files.
Related guides
In this post