
Automated Terraform lab environment for OpenSSH on Linux with musl libc without PAM (CVE-2026-123158 research)
A self-contained Terraform lab environment for studying and researching OpenSSH authentication behaviors before version 10.6p2 when compiled against musl libc without PAM (UsePAM no).
The lab deploys an Azure virtual machine with a dual-SSH port architecture to isolate administrative access from the target research environment:
Internet / Client
│ │
Port 2222 │ │ Port 22
(Host Management) │ │ (Target Research Service)
▼ ▼
┌──────────────────────────────────────────────────────────┐
│ Azure Virtual Machine (Ubuntu 22.04 LTS) │
│ │
│ • Host OpenSSH Server (sshd listening on Port 2222) │
│ • Docker Engine & Cloud-Init Provisioning │
│ │
│ ┌────────────────────────────────────────────────────┐ │
│ │ Container: musl-sshd (Alpine 3.20 base) │ │
│ │ │ │
│ │ • OpenSSH 9.8p1 built against musl libc │ │
│ │ • Built with --without-pam (UsePAM no) │ │
│ │ • Listens on Port 22 │ │
│ │ • User accounts: victim (*), testuser (*), │ │
│ │ saltuser (password hash for salt retrieval) │ │
│ └────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────┘
musl libc without PAM (UsePAM no).tls_private_key and saves id_rsa locally with secure permissions (0600) using local_sensitive_file.null_resource.wait_for_cloud_init automatically monitors cloud-init status --wait over SSH (port 2222) to guarantee that container compilation and setup are completely finished before terraform apply returns.victim: Account with * in /etc/shadow (simulating key-only or passwordless accounts).testuser: Additional test account with * in /etc/shadow.saltuser: Account with a valid password hash (SaltUserValidPass123!) to supply salts for timing mitigation logic.>= 1.5.0Export your Azure credentials or source an environment file:
export ARM_CLIENT_ID="<your-client-id>"
export ARM_CLIENT_SECRET="<your-client-secret>"
export ARM_SUBSCRIPTION_ID="<your-subscription-id>"
export ARM_TENANT_ID="<your-tenant-id>"
terraform init
terraform apply
During apply, Terraform will:
id_rsa and id_rsa.pub.musl libc, start the container, and verify the service status.Connect to the Ubuntu host VM using the auto-generated private key:
# Direct command (from PowerShell or native Linux):
ssh -i ./id_rsa -p 2222 azureuser@<PUBLIC_IP>
# Note for WSL users accessing /mnt/c:
# If DrvFs prevents 0600 permission checks, copy to /tmp first:
install -m 600 id_rsa /tmp/id_rsa && ssh -i /tmp/id_rsa -p 2222 azureuser@<PUBLIC_IP>
Interact with the research daemon on port 22:
ssh victim@<PUBLIC_IP> -p 22
Once connected to the host via port 2222:
Check Container Status:
sudo docker ps
Inspect OpenSSH Container Logs:
sudo docker logs -f musl-sshd
Check Cloud-Init Provisioning Logs:
tail -n 100 /var/log/cloud-init-musl-ssh.log
| Variable | Description | Default |
|---|---|---|
resource_group_name | Name of the Azure Resource Group | rg-musl-sshd-lab |
location | Azure Region | westeurope |
vm_name | Name of the Virtual Machine | vm-musl-sshd |
vm_size | Azure VM SKU | Standard_B2s |
admin_username | Administrative user for host OS | azureuser |
tags | Tags applied to all resources | (See variables.tf) |
| Output | Description |
|---|---|
public_ip | Public IP address assigned to the VM |
host_admin_ssh_command | Ready-to-use SSH command for host management (port 2222) |
vulnerable_musl_ssh_command | SSH command for the musl daemon (port 22) |
private_key_file | Path to the auto-generated private key |
resource_group_name | Deployed Resource Group name |
To destroy all deployed Azure resources and clean up local keys and state:
terraform destroy