HANDS-ON TASK · 1 OF 1

Lock down secrets and a helper tool

Project: Lock down secrets and a helper tool

You're a Linux administrator at esc bash. A developer handed over a server in a rough state: a secrets file anyone on the machine can read, an SSH key folder with wide-open permissions, and a deploy helper that only runs if you type its full path. Clean it all up.

Set up the project

Run this first. It recreates the mess for you to fix:

bash
curl -fsSL https://raw.githubusercontent.com/Esc-Bash/project-init-scripts/main/linux/project-3/init.sh | bash

This creates /root/app/secrets.env, a loose /root/.ssh folder with a key pair, and a helper script at /root/tools/deploy-helper.sh.

What to fix

  1. Lock down /root/app/secrets.env so only its owner can read and write it, with no access for group or others.
  2. Fix the SSH key folder permissions:
    • /root/.ssh itself: owner-only access (read, write, and enter).
    • /root/.ssh/id_rsa (the private key): owner read and write only.
    • /root/.ssh/id_rsa.pub (the public key): owner read and write, everyone else read only.
  3. Make the deploy helper runnable from anywhere by the name deploy-helper (not its full path). Put it on your PATH in a way that still works in a brand-new shell. The helper itself lives at /root/tools/deploy-helper.sh.
  4. Add an alias named deploy to /root/.bashrc that runs the helper.

When the checks pass, press Submit.

Start the lab on the right to run checks.

Pass the checks to continue
Spin up a fresh environment and practice live.
linux-devops-basic · fresh machine · ready in under a minute