Unconditional 'exec < /dev/tty' broke non-interactive SSH invocations where /dev/tty isn't openable. Move the reattach into the env-prompt branch and skip it cleanly if /root/.quiz.env was pre-populated, with a clear error if both stdin and /root/.quiz.env are missing.