https://github.com/folixg/yubikey-windows-lock
Lock your Windows machine when Yubikey is removed
https://github.com/folixg/yubikey-windows-lock
locking screenlock screenlocker windows windows-10 windows-desktop yubico yubikey
Last synced: 9 months ago
JSON representation
Lock your Windows machine when Yubikey is removed
- Host: GitHub
- URL: https://github.com/folixg/yubikey-windows-lock
- Owner: folixg
- License: mit
- Created: 2022-04-06T13:06:03.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-07T14:46:34.000Z (about 4 years ago)
- Last Synced: 2025-03-31T14:11:17.399Z (about 1 year ago)
- Topics: locking, screenlock, screenlocker, windows, windows-10, windows-desktop, yubico, yubikey
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: readme.rst
- License: LICENSE
Awesome Lists containing this project
README
####################
Yubikey Windows Lock
####################
A script to lock your Windows machine once a formerly connected Yubikey
is removed.
Requirements
============
Needs a Python installation and yubikey-manager which can be installed with
.. code-block:: shell
pip install --user yubikey-manager
Usage
=====
Command Line Options
--------------------
.. code-block::
usage: yubikey_windows_lock.py [-h] [-s SERIAL] [-w WAIT]
Lock Windows when Yubikey is removed
options:
-h, --help show this help message and exit
-s SERIAL, --serial SERIAL
Limit to yubikey with this serial number
-w WAIT, --wait WAIT The time (in s) between two checks (default: 2)
Start At Windows Login
----------------------
An easy way to automatically launch the script on Windows login is to use Windows Task Scheduler.
Create a basic task that is executed on logon and as action starts a program.
In the ``Program/Script`` field provide the path to ``pythonw.exe`` of your Python installation.
Typically that is
.. code-block::
C:\Users\\AppData\Local\Programs\Python\\pythonw.exe
In the ``Add arguments`` field you provide the path to ``yubikey_windows_lock.py`` and optionally the
arguments you want to provide to the script.
So it should look something like
.. code-block::
C:\Users\\\yubikey_windows_lock.py -w 3 -s