Code Monkey home page Code Monkey logo

u2flock's Introduction

U2F Lock

This small application provides an easy way to lock and unlock your i3lock session using a FIDO U2F Token (Yubico Security Key, Google Titan Security Key).

Features

  • Register multiple Keys
  • Unlock (kill) i3lock by connecting and activating your Key
  • Lock your device with custom command when disconnecting a known Key (default: systemctl suspend)

Usage

Install

go get -u github.com/kwiesmueller/u2flock

Preparing

The Token registration handles get stored in a json file. Always override the default value.

u2flock -register -key=/home/yourUsername/.secret/u2flock-key.json

Touch your token when being asked.

Unlocking

Add the following snippet to your lock.sh right after the i3lock call:

U2FLOCKKEY=$HOME/.secret/u2flock-key.json
$HOME/go/bin/u2flock -key=$U2FLOCKKEY &

Now when locking you should be able to connect your Key and press the button to unlock.

Locking

To autolock when disconnecting a known token, add the following snippet to your xinitrc file:

u2flock -watch -lockCmd=$HOME/.config/i3/lock.sh -lockArgs="" &

Not setting -lockCmd and -lockArgs will suspend instead of locking.

Disclaimer

This project is built for private purposes, barely tested and probably not secure. U2F should be used as a 2nd factor rather than this.

The author is not liable for any harms caused by using this software.

A License can be found in LICENSE.

u2flock's People

Contributors

kwiesmueller avatar

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.