Ubuntu 22.04 LTS Minimal on AWS User Guide
Overview
This guide covers launching and verifying the Ubuntu 22.04 LTS Minimal AMI from cloudimg on Amazon EC2. It is one version of the cloudimg Ubuntu listing on AWS Marketplace; you pick it as the software version when you subscribe and launch.
Ubuntu 22.04 (Jammy Jellyfish) is a long term support (LTS) release from Canonical, with standard security maintenance to 2027. This image starts from Ubuntu Server 22.04 LTS for EC2 and adds four things:
- A trimmed package set. 19 packages a cloud server does not need are removed (the release upgrader, boot splash and recovery menu, crash reporters, the signed firmware updater component, iSCSI and multipath, the LXD agent loader, telnet and ftp), and snapd is purged with every snap. Each removal is simulated first and refused if it would take a package the instance needs to boot, network or be reached. The list ships on the image.
- CIS Level 1 Server remediation. The image is remediated with the OpenSCAP CIS Level 1 Server profile from SCAP Security Guide 0.1.82, then rebooted and evaluated. On this build 335 of 342 scored rules pass (98.0%). Six rules are waived because they cannot work on an EC2 image, each with its reason. The HTML report, the machine-readable results, the waiver list and a summary ship in
/usr/share/doc/cloudimg/. - EC2 defaults that keep you in control. Key-only SSH as
ubuntu, root locked, no password on any account, IMDSv2 required, a host firewall (ufw) that allows SSH in and everything out, the AWS Systems Manager agent installed as a normal package, and time from the Amazon Time Sync Service. - Fully patched at build time, with unattended security upgrades switched on for your instance.
What is on the image: Ubuntu Server 22.04 LTS (AWS kernel), cloud-init, OpenSSH, ufw, chrony, the AWS Systems Manager agent, AppArmor, AIDE file integrity checking, OpenSCAP and the pinned SCAP Security Guide content used for the evaluation.
Default user: ubuntu · Architecture: x86_64 · Root volume: 8 GiB gp3 (grows to the size you choose at launch)
These images are remediated with an OpenSCAP profile and ship their own evaluation report. They are not CIS Hardened Images, and CIS has not reviewed or certified them.
Security posture
- No known credential. There is no default password and no baked in SSH key. The only key that works is the EC2 key pair you choose at launch, which cloud-init installs for
ubuntuon first boot. - Key-only SSH.
PasswordAuthentication no,PermitRootLogin no, keyboard-interactive off. The root account has no password and is locked. - Per-instance identity. SSH host keys and the machine ID are generated fresh on every instance, so no two instances share a host key.
- IMDSv2 required. The AMI is registered with
ImdsSupport v2.0, so instances launched from it refuse token-less (IMDSv1) metadata requests by default. - Host firewall. ufw denies inbound traffic except SSH on 22 and allows outbound traffic, so the SSM agent, metadata service, DNS, time and package updates keep working.
- Only SSH listens on the network. Everything else on the image listens on loopback only.
Prerequisites
- An AWS account and permission to launch EC2 instances
- An EC2 key pair in the Region you launch in
- A security group that allows TCP 22 from your own address (not from the whole internet)
Recommended instance type: m5.large. The image runs on any current x86_64 instance type.
Step 1: Launch the instance
Option A: AWS Marketplace console
- Open the cloudimg Ubuntu listing on AWS Marketplace and choose Continue to Subscribe, then Continue to Configuration.
- Under Software version, choose Ubuntu 22.04 LTS Minimal, then pick your Region and choose Continue to Launch.
- Choose Launch through EC2 for the full launch wizard.
- Pick an instance type (
m5.largerecommended) and your key pair. - Under Network settings, allow SSH (port 22) from My IP only.
- Under Configure storage, set the root volume size you want (8 GiB minimum). The root filesystem grows to fill it on first boot.
- Choose Launch instance.
Option B: AWS CLI
Run this on your own workstation. Replace the AMI ID with the one shown for your Region on the Marketplace launch page, and the key pair, security group and subnet with your own:
aws ec2 run-instances \
--image-id ami-0123456789abcdef0 \
--instance-type m5.large \
--key-name my-key-pair \
--security-group-ids sg-0123456789abcdef0 \
--subnet-id subnet-0123456789abcdef0 \
--block-device-mappings 'DeviceName=/dev/sda1,Ebs={VolumeSize=20,VolumeType=gp3}' \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=ubuntu-2204-minimal}]'
You do not need --metadata-options: the AMI already makes IMDSv2 required.
Step 2: Connect via SSH
From your workstation, connect as ubuntu with the key pair you chose:
ssh -i ~/.ssh/my-key-pair.pem ubuntu@<public-ip>
There is no password to enter. If SSH asks for one, or says Too many authentication failures, see Troubleshooting below.
You can also connect without opening port 22 at all through AWS Systems Manager Session Manager, if the instance has an instance profile that allows Systems Manager. The agent is installed and running on this image.
Step 3: Confirm the release
grep -E '^(NAME|VERSION|ID|VERSION_ID|PRETTY_NAME)=' /etc/os-release
uname -srm
dpkg --print-architecture
Expected output:
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
ID=ubuntu
Linux 6.8.0-1066-aws x86_64
amd64

The -aws kernel is Canonical's kernel flavour for EC2, with the Nitro network and NVMe drivers built in. Your kernel version may be newer if updates have installed since this image was built.
Step 4: See what the Minimal trim removed
The image lists exactly what was removed, and anything that a removal would have taken with it is kept and listed instead:
cat /usr/share/doc/cloudimg/minimal-manifest.txt
dpkg-query -W -f='${Package}\n' | wc -l
Expected output:
Minimal version: packages 609 -> 550
Removed:
landscape-common
ubuntu-release-upgrader-core
apport
apport-symptoms
friendly-recovery
ntfs-3g
open-iscsi
multipath-tools
plymouth
fwupd-signed
bolt
usb-modeswitch
pollinate
byobu
motd-news-config
lxd-agent-loader
sosreport
telnet
ftp
Kept (a removal would have taken a protected package, or it failed):
567
The trim takes the package count from 609 to 550, including the dependencies that left with those 19 packages. Nothing had to be kept back. The CIS remediation then adds the tools it needs (OpenSCAP, AIDE and their libraries), which is why the installed count is a little higher. The count on your instance moves by a few as kernels and updates install.
Anything removed is one sudo apt-get install away from the standard Ubuntu archives.
Step 5: Read the compliance evidence
The evaluation the build ran after its reboot ships on the image:
ls -lh /usr/share/doc/cloudimg/
python3 -c "import json; s=json.load(open('/usr/share/doc/cloudimg/cis-l1-summary.json')); print('profile: ', s['profileLabel'], '(SCAP Security Guide', s['ssgVersion'] + ')'); print('scored rules: ', s['scored'], ' pass:', s['pass'], ' fail:', s['fail'], ' rate:', str(s['ratePct']) + '%'); print('waived: ', s['waived'], ' not applicable:', s['notapplicable']); print('evaluated at: ', s['evaluatedAt'])"
Expected output:
total 20M
-rw-r--r-- 1 root root 17M Oct 18 19:12 cis-l1-arf.xml
-rw-r--r-- 1 root root 2.6M Oct 18 19:12 cis-l1-report.html
-rw-r--r-- 1 root root 1.4K Oct 18 19:12 cis-l1-summary.json
-rw-r--r-- 1 root root 2.1K Oct 18 19:12 cis-l1-tailoring.xml
-rw-r--r-- 1 root root 2.3K Oct 18 19:12 cis-l1-waivers.txt
-rw-r--r-- 1 root root 388 Oct 18 19:07 minimal-manifest.txt
-rw-r--r-- 1 root root 1.6K Oct 18 19:07 scap-security-guide-LICENSE.txt
profile: CIS Level 1 Server (SCAP Security Guide 0.1.82)
scored rules: 342 pass: 335 fail: 7 rate: 98.0%
waived: 6 not applicable: 50
evaluated at: 2026-10-18T19:12:29Z

cis-l1-report.htmlis the full OpenSCAP report, rule by rule. Copy it to your workstation and open it in a browser.cis-l1-arf.xmlis the same evaluation in the machine-readable ARF format, for compliance tooling.cis-l1-tailoring.xmlis the exact tailoring used, so you can re-run the same evaluation (Step 6).- The pass rate is pass / (pass + fail + error + unknown). Rules that are not applicable to this machine, not selected, or waived are not counted.
To copy the report to your workstation, run this on the workstation:
scp -i ~/.ssh/my-key-pair.pem ubuntu@<public-ip>:/usr/share/doc/cloudimg/cis-l1-report.html .
The six waived rules
grep -v '^#' /usr/share/doc/cloudimg/cis-l1-waivers.txt | cut -f1,2
Expected output:
partition_for_tmp [single-volume-partitions]
grub2_password [serial-console-and-boot]
grub2_uefi_password [serial-console-and-boot]
accounts_maximum_age_login_defs [key-only-account-aging]
account_disable_post_pw_expiration [key-only-account-aging]
sshd_limit_user_access [ssh-access-list]
The full reason for each is the third column of the same file. In short:
- Separate /tmp partition: this version boots from one EBS root volume. (The LVM versions of this listing provide separate volumes for /tmp, /var, /var/log, /var/log/audit, /var/tmp and /home.)
- Boot loader passwords: a GRUB password would have to be baked into the image, giving every instance the same secret. Set your own if you need one (see Step 11).
- Password ageing defaults: the accounts cloud-init creates are key-only. An ageing limit would expire them and lock the SSH key out.
- SSH AllowUsers/AllowGroups: a list fixed at build time would refuse accounts you create later. Your security group restricts who can reach port 22.
The seven rules that do not pass
python3 -c "import json; [print(r) for r in json.load(open('/usr/share/doc/cloudimg/cis-l1-summary.json'))['failingRules']]"
Expected output:
ensure_root_access_controlled
root_path_all_dirs
service_nftables_enabled
set_nftables_loopback_traffic
set_nftables_table
set_ufw_default_rule
ufw_rules_for_open_ports
What each one means on this image:
ensure_root_access_controlled: the Ubuntu 22.04 version of this check passes only when root has a password hash. A root password on the image would be the same secret on every instance, so root has no password at all and is locked instead (sudo passwd -S rootshowsL, Step 11). Nobody can log in as root; administrators usesudo.root_path_all_dirs: root'sPATHstill lists/snap/bin, which no longer exists because snapd is removed. It is harmless.service_nftables_enabled,set_nftables_loopback_trafficandset_nftables_table: these check for the nftables service and a hand-written nftables configuration. The firewall on this image is ufw, andnftables.serviceis masked so it can never start and flush ufw's rules at boot. Running two firewall front ends at once is what the benchmark itself warns against.set_ufw_default_rule: the benchmark wants outbound traffic denied by default. This image allows outbound so the SSM agent, metadata service, DNS, time sync and updates work out of the box.ufw_rules_for_open_ports: the DHCP client (systemd-networkd, UDP 68 on the instance's private address) has no explicit ufw rule. It is the client that keeps the instance's address, not a service.
Step 6: Re-run the evaluation yourself
You can repeat the evaluation at any time with the same content and tailoring. It takes under a minute:
sudo oscap xccdf eval \
--tailoring-file /usr/share/doc/cloudimg/cis-l1-tailoring.xml \
--profile xccdf_co.cloudimg_profile_cis-l1_ec2_single \
--results /tmp/cis-check-results.xml --report /tmp/cis-check-report.html \
/usr/share/xml/scap/ssg/content/ssg-ubuntu2204-ds.xml > /tmp/cis-check.log 2>&1
echo "oscap exit code: $? (2 = at least one rule did not pass)"
sudo python3 -c "import re,collections; c=collections.Counter(re.findall(r'<result>(\w+)</result>', open('/tmp/cis-check-results.xml').read())); s=sum(c[k] for k in ('pass','fail','error','unknown')); print(dict(sorted(c.items()))); print('pass rate: %.1f%%' % (100.0*c['pass']/s))"
Expected output on a freshly launched instance:
oscap exit code: 2 (2 = at least one rule did not pass)
{'fail': 7, 'notapplicable': 50, 'notselected': 247, 'pass': 335}
pass rate: 98.0%
Your own report is at /tmp/cis-check-report.html. As you install software and change settings, re-run this to see how your changes affect the result.
Step 7: Confirm IMDSv2 is required
curl -s -o /dev/null -w 'IMDSv1 request without a token: HTTP %{http_code}\n' http://169.254.169.254/latest/meta-data/instance-id
TOKEN=$(curl -s -X PUT -H 'X-aws-ec2-metadata-token-ttl-seconds: 60' http://169.254.169.254/latest/api/token)
curl -s -H "X-aws-ec2-metadata-token: $TOKEN" -w '\n' http://169.254.169.254/latest/meta-data/placement/region
Expected output (your Region may differ):
IMDSv1 request without a token: HTTP 401
us-east-1
A request without a session token is refused with HTTP 401, and the same request with a token works. Scripts and SDKs on the instance must use IMDSv2; every current AWS SDK and the AWS CLI do this automatically.
Step 8: The host firewall and listening ports
sudo ufw status verbose
sudo ss -tlnp
Expected output:
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
To Action From
-- ------ ----
Anywhere on lo ALLOW IN Anywhere
22/tcp ALLOW IN Anywhere
Anywhere DENY IN 127.0.0.0/8
Anywhere (v6) on lo ALLOW IN Anywhere (v6)
22/tcp (v6) ALLOW IN Anywhere (v6)
Anywhere (v6) DENY IN ::1
Anywhere ALLOW OUT Anywhere on lo
Anywhere (v6) ALLOW OUT Anywhere (v6) on lo
State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=603,fd=3))
LISTEN 0 100 127.0.0.1:25 0.0.0.0:* users:(("master",pid=1084,fd=13))
LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=355,fd=14))
LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=603,fd=4))
LISTEN 0 100 [::1]:25 [::]:* users:(("master",pid=1084,fd=14))

Only sshd listens on the network. The DNS stub resolver (53) and the local mail relay (25, for system mail) listen on loopback only.
Opening a port for your own service takes two steps: allow it in the instance's security group, and allow it in ufw. For example, for a web server on 443, run on the instance:
sudo ufw allow 443/tcp
If a port is open in the security group but not in ufw (or the other way round), the traffic will not arrive.
Step 9: Time sync and the Systems Manager agent
systemctl is-active chrony amazon-ssm-agent
chronyc -n sources
dpkg -s snapd >/dev/null 2>&1 && echo "snapd: installed" || echo "snapd: not installed"
Expected output (the pool servers and timings vary):
active
active
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 169.254.169.123 3 4 177 2 -804ns[+3750ns] +/- 570us
^- 185.125.190.57 2 6 17 48 -1406us[-1392us] +/- 45ms
^- 185.125.190.58 2 6 17 50 +1379us[+1394us] +/- 50ms
^- 185.125.190.56 2 6 17 49 +1370us[+1385us] +/- 49ms
^- 91.189.91.157 2 6 27 47 +651us[ +666us] +/- 29ms
^- 38.80.8.230 2 6 17 50 -138us[ -123us] +/- 18ms
^- 216.66.48.42 1 6 17 49 +2238us[+2253us] +/- 9428us
^- 66.118.230.14 2 6 17 49 +4057us[+4071us] +/- 129ms
^- 38.45.64.130 2 6 17 49 -753us[ -738us] +/- 14ms
^? 129.6.15.25 1 6 1 57 +35us[ -637ms] +/- 5459us
^? 129.6.15.28 1 6 1 56 +52us[ -637ms] +/- 6049us
^? 129.6.15.29 1 6 1 55 -22us[ -637ms] +/- 5923us
^? 129.6.15.30 1 6 1 58 -47us[ -637ms] +/- 6047us
snapd: not installed
The ^* marks the source chrony is using: 169.254.169.123, the Amazon Time Sync Service. It is reachable from every instance without internet access, so time stays correct in a private subnet too. The public Ubuntu pool servers are fallbacks (^? marks a server chrony has only just started polling).
The AWS Systems Manager agent is installed from Amazon's Debian package rather than as a snap, and snapd is removed.
Step 10: Patch level and automatic updates
The image is fully patched at build time. Check what is pending now:
sudo apt-get update -qq
apt-get -s -o APT::Get::Always-Include-Phased-Updates=true dist-upgrade | awk '/^Inst /{n++} END{print "pending upgrades: " n+0}'
apt-mark showhold
uname -r
Expected output on an instance launched soon after the image was built (later launches show the updates released since):
pending upgrades: 0
6.8.0-1066-aws
unattended-upgrades is on, so security updates install automatically every day. To update everything now, run:
sudo apt-get update && sudo apt-get -y dist-upgrade
Reboot if a new kernel was installed:
sudo systemctl reboot
Step 11: Security settings on the instance
sudo aa-status --enabled && echo "apparmor: enabled"
sudo passwd -S root
sudo sshd -T | grep -E '^(permitrootlogin|passwordauthentication|pubkeyauthentication|maxauthtries|clientaliveinterval) '
cat /etc/issue.net
Expected output:
apparmor: enabled
root L 10/14/2026 0 99999 7 -1
maxauthtries 4
clientaliveinterval 300
permitrootlogin no
pubkeyauthentication yes
passwordauthentication no
Authorized users only. All activity may be monitored and reported.

Lmeans the root account is locked.maxauthtries 4andclientaliveinterval 300come from the CIS profile: SSH allows four authentication attempts per connection and checks idle sessions every five minutes.- The banner text is shown before login.
EC2 Serial Console and recovery. No account on this image has a password, so the serial console cannot log in until you set one. If you want serial console access, set a password for your own user on your running instance (the password is yours and is not on the image):
sudo passwd ubuntu
Step 12: Disk size, swap and file integrity
df -h /
sudo awk '/cc_growpart/ && /(resized|NOCHANGE)/' /var/log/cloud-init.log | tail -1
swapon --noheadings --show | wc -l
sudo ls -l /etc/cron.daily/aide
Expected output with the default 8 GiB root volume (on a larger volume, Size is larger and the cloud-init line says resized):
Filesystem Size Used Avail Use% Mounted on
/dev/root 7.6G 2.0G 5.7G 26% /
2026-10-18 19:11:52,397 - cc_growpart.py[DEBUG]: '/' NOCHANGE: no change necessary (/dev/nvme0n1, 1)
0
-rwxr-xr-x 1 root root 34194 Dec 30 2021 /etc/cron.daily/aide
- Disk growth. cloud-init grows the root partition and filesystem to the volume size on first boot. To grow later, increase the EBS volume size in the console or with
aws ec2 modify-volume, then reboot (or runsudo growpart /dev/nvme0n1 1 && sudo resize2fs /dev/nvme0n1p1). - Swap. The image has no swap. Add a swap file yourself if your workload needs one.
- AIDE. The file integrity database is built from the image's own files, and Ubuntu 22.04's AIDE package runs its daily check from
/etc/cron.daily/aide.
Step 13: Install software and add users
The instance uses the standard Ubuntu archives:
sudo apt-get update -qq
apt-cache policy nginx | sed -n '1,3p'
Expected output (the version changes over time):
nginx:
Installed: (none)
Candidate: 1.18.0-6ubuntu14.21
Install and start software in the usual way, for example sudo apt-get install -y nginx then sudo systemctl enable --now nginx, and open its port in the security group and ufw (Step 8).
To add another administrator, create the account, add it to the sudo group and give it an SSH key:
sudo adduser --disabled-password --gecos "" alice
sudo usermod -aG sudo alice
sudo install -d -m 700 -o alice -g alice /home/alice/.ssh
echo "ssh-ed25519 AAAA... alice@laptop" | sudo tee /home/alice/.ssh/authorized_keys
sudo chown alice:alice /home/alice/.ssh/authorized_keys && sudo chmod 600 /home/alice/.ssh/authorized_keys
Because SSH is key-only, a new account needs its key in authorized_keys. The new account has no password, so sudo cannot authenticate it until you give it one with sudo passwd alice. SSH stays key-only; the password is used by sudo. (Only ubuntu, created by cloud-init, has password-free sudo.)
Common use cases
- A base for workloads that must show CIS Level 1 alignment on Ubuntu 22.04, with the evaluation report already on the machine
- Software that is certified or packaged for Ubuntu 22.04 rather than 24.04
- Container hosts and automation targets that want a small Ubuntu LTS base with no snaps
- Fleets managed through Systems Manager, with IMDSv2 required from the first boot
- A starting point for your own golden image: add your software, re-run Step 6, and keep the report with your build
Troubleshooting
SSH says "Too many authentication failures"
The SSH server allows four authentication attempts per connection. If your SSH agent holds several keys, it can use them up before it offers the right one. Tell SSH to offer only the key you name:
ssh -o IdentitiesOnly=yes -i ~/.ssh/my-key-pair.pem ubuntu@<public-ip>
Cannot connect via SSH
- Check the instance is running and has passed its status checks.
- Check the security group allows TCP 22 from your current public address.
- Use the user name
ubuntuand the key pair chosen at launch. Password login is disabled, so a wrong key never falls back to a password prompt. - If you changed ufw, make sure 22/tcp is still allowed. Session Manager (Step 2) still works if SSH is blocked, provided the instance has a Systems Manager instance profile.
My service is running but not reachable
Allow the port in both the security group and ufw (Step 8). sudo ufw status shows the ufw rules; sudo ss -tlnp shows whether the service listens on all addresses or only on loopback.
A tool that uses instance metadata fails
The image requires IMDSv2. Old scripts that call http://169.254.169.254/ without a token get HTTP 401. Update them to request a token first (Step 7), or use the AWS CLI or a current SDK.
Package manager issues
Refresh the package lists first:
sudo apt-get update
If the archives are unreachable, check that the instance has outbound internet access (a public IP or a NAT gateway) and that DNS resolves:
getent hosts archive.ubuntu.com
Important notes
Ubuntu is free and open source software. It is a distribution of thousands of packages, each under its own licence (GPL, LGPL, MIT, BSD, Apache 2.0 and others); each package's terms are in /usr/share/doc/<package>/copyright. No subscription or licence key is needed to run this image. The compliance tooling is OpenSCAP (LGPL 2.1 or later) and SCAP Security Guide content (BSD 3-Clause, licence text in /usr/share/doc/cloudimg/scap-security-guide-LICENSE.txt).
Ubuntu 22.04 LTS receives standard security maintenance until 2027. For a longer runway on a new deployment, the Ubuntu 24.04 LTS versions of this listing are maintained until 2029.
The CIS Level 1 Server profile used here is the OpenSCAP profile published in SCAP Security Guide. These images are not CIS Hardened Images and are not certified by the Center for Internet Security. A pass rate measures this image as built; your own changes affect it, which is why the evaluation can be re-run (Step 6).
Ubuntu is a trademark of Canonical Ltd. CIS is a trademark of the Center for Internet Security. Both names are used only to identify the software and the profile. cloudimg is not affiliated with or endorsed by Canonical Ltd or the Center for Internet Security.
Support
For help with this image, contact cloudimg support:
- Website: www.cloudimg.co.uk
- User Guides: www.cloudimg.co.uk/guides
- Ubuntu on AWS hub: www.cloudimg.co.uk/guides/ubuntu-server-aws