Git Product home page Git Product logo

yubikey-windows-lock's Introduction

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

pip install --user yubikey-manager

Usage

Command Line Options

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

C:\Users\<your_username>\AppData\Local\Programs\Python\<your_python_version>\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

C:\Users\<your_username>\<path_to_this_repo>\yubikey_windows_lock.py -w 3 -s <your_yubikey_serial>

yubikey-windows-lock's People

Contributors

folixg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

yubikey-windows-lock's Issues

Multiple SERIAL Number Handling

Sorry if I'm being naive, but how would one set this up with two yubikey devices?

Only I'm trying to ensure that from the start both keys can do everything, as I need the backup to be there just in case.

(unfortunately not savvy enough to help with the code, so totally understand if you don't want to answer)

If I were to try to think of a business case, it might be that an admin key would also function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.