15/60
Sign inSign up free

760. Generate Strong Passwords

medium 20 XP ~10 minHands-on lab

Write /home/student/bin/genpass.sh [LENGTH] [COUNT] for the provisioning scripts.

Task

  • Print COUNT passwords (default 1), one per line, each exactly LENGTH characters (default 20).
  • Use only the characters A-Z, a-z and 0-9, taken from /dev/urandom (not $RANDOM).
  • Every password contains at least one upper-case letter, one lower-case letter and one digit.
  • LENGTH must be a whole number from 8 to 128, and COUNT from 1 to 100; otherwise print a usage line to stderr and exit 2.

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.