Skip to content

Latest commit

 

History

History
90 lines (57 loc) · 2.32 KB

File metadata and controls

90 lines (57 loc) · 2.32 KB

Linux Command Line CTF Lab - GCP

Prerequisites

  1. Terraform (v1.9.0 or later)
  2. gcloud CLI
  3. A Google Cloud account with a project and billing enabled

Getting Started

  1. Clone this repository:

    git clone https://github.com/learntocloud/linux-ctfs
    cd linux-ctfs/gcp
  2. Log in to Google Cloud:

gcloud auth login
gcloud auth application-default login
  1. 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 yes when prompted.

    If you run into errors when deploying, see TROUBLESHOOTING.md for common issues and fixes.

  2. Note the public_ip_address output—you'll use this to connect.

Accessing the Lab

  1. Connect via SSH:

    ssh ctf_user@<public_ip_address>
  2. On first login you will be asked if you want to add fingerprints to the known hosts file; type yes and press Enter.

  3. When prompted, enter the password: CTFpassword123!

Timer Behavior

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.

Cleaning Up

Destroy the resources when you're done to avoid charges:

terraform destroy

Type yes when prompted.

Troubleshooting

  1. Ensure your gcloud CLI is authenticated
  2. Check that you're using Terraform v1.9.0 or later
  3. 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 version
  • gcloud auth list --filter=status:ACTIVE output (no secrets)
  • The exact terraform apply error output (redact any secrets)
  • Whether SSH fails or the issue happens after login, such as when running verify progress

Security Note

This lab uses password authentication for simplicity. In production, use key-based authentication.