← all posts
Accessing the UoY VPN and VDS without using the Duo 2FA app
tl;dr:
- Download duo-cli
- Make a virtual environment and activate it:
python3.6 -m venv venv && . venv/bin/activate
- Install the requirements:
pip install -r requirements.txt
- Go to https://duo.york.ac.uk
- Get to the "add a device" flow
- if this is the first device you're adding, probably this is the
first screen you'll see
- otherwise, authenticate with an existing device, then click "Add
another device"
- Choose "tablet", then "Android"
- Pretend you have the Duo app installed, then click "Email me an
activation link instead"
- In the virtual environment, run
./duo_activate.py URL, where URL
is the link you just got emailed
- Each time you need a code, run
./duo_gen.py
- If you want to use a different 2FA app, run
./duo_export.py and
scan the QR code it prints
Important note: the codes are counter-based, not time-based, so you
must not generate codes which you don't use, or your local counter will
get out of sync with the server's counter and your codes will no longer
work.