Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yubiKeyLock

This program locks your Windows PC once you remove your Yubikey. The script keeps a startup fallback: on first run, if no approved key is present, it exits instead of locking. This allows login if you forgot your key at home.

Requirements

  • Python 3 on Windows
  • Yubico YubiKey Manager CLI (ykman) installed and available in PATH

Configuration

  1. List connected key serial numbers: ykman list --serials
  2. Edit yubicheck_config.json and set:
    • check_interval_seconds
    • whitelisted_serials (list of allowed serials)

Config file location

  • Script mode: config is read from the same folder as yubicheck.py.
  • EXE mode: config is read from the same folder as the compiled .exe.
  • This allows changing serials/interval without rebuilding the executable.

Behavior

  • If a whitelisted serial is present, the script continues running.
  • If no whitelisted serial is present after startup, the workstation is locked.
  • On first run only, if no whitelisted serial is present, the script exits (startup fallback).
  • On first run, if unwhitelisted YubiKey serials are detected, the script offers a 10 second y/n prompt to add them to yubicheck_config.json.

About

This python file checks if your YubiKey is ejected in the Background every 10 seconds. If so your pc is locked. Win only

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages