- Terraform (v1.9.0 or later)
- gcloud CLI
- A Google Cloud account with a project and billing enabled
-
Clone this repository:
git clone https://github.com/learntocloud/linux-ctfs cd linux-ctfs/gcp -
Log in to Google Cloud:
gcloud auth login
gcloud auth application-default login-
Initialize and apply Terraform:
terraform init terraform apply \ -var gcp_project="YOUR_GCP_PROJECT_ID" \ -var gcp_region="YOUR_GCP_REGION" \ -var gcp_zone="YOUR_GCP_ZONE"
Replace the values with your project ID and preferred region/zone (defaults to us-central1/us-central1-a).
Type
yeswhen prompted.If you run into errors when deploying, see TROUBLESHOOTING.md for common issues and fixes.
-
Note the
public_ip_addressoutput—you'll use this to connect.
-
Connect via SSH:
ssh ctf_user@<public_ip_address>
-
On first login you will be asked if you want to add fingerprints to the known hosts file; type
yesand press Enter. -
When prompted, enter the password:
CTFpassword123!
verify time uses wall clock elapsed time. The timer starts on your first challenge submission and freezes on your first successful verify export after you've solved all 18 real challenges.
Destroy the resources when you're done to avoid charges:
terraform destroyType yes when prompted.
- Ensure your gcloud CLI is authenticated
- Check that you're using Terraform v1.9.0 or later
- Verify you have permissions to create Compute Engine instances and firewall rules
If problems persist, please open an issue:
https://github.com/learntocloud/linux-ctfs/issues
Include:
- GCP project + region/zone
terraform versiongcloud auth list --filter=status:ACTIVEoutput (no secrets)- The exact
terraform applyerror output (redact any secrets) - Whether SSH fails or the issue happens after login, such as when running
verify progress
This lab uses password authentication for simplicity. In production, use key-based authentication.