Code Monkey home page Code Monkey logo

systemd-password-agent's Introduction

systemd-password-agent

Deprecation Notice: with "ask-password" caching implemented as of systemd-227 (2015-10-07), there's likely no reason to use this tool, as such in-kernel caching seem to be a better alternative, but likely requires systemd running in initramfs.

Python implementation of systemd password agent interface.

Honest to $DEITY implementation of the interface in form of python script (for ease of hackability), with all the inotify, timestamp, policykit goodies and checks.

Needs python2.7 implementation with ctypes support (vanilla cpython will do).

Usage

  • Clone.

  • Copy the py script to some more-or-less stable path (like /usr/local/bin/systemd_password_cache, just make sure it matches what's in the .service files).

  • Override get_pass() function in the script with whatever you need to get the password, like:

      def get_pass():
        cache_path = '/run/initramfs/.password.cache'
        try: return open(cache_path, 'rb').read().strip()
        except (OSError, IOError): raise SkipRequest
    
  • Install .service file to run the thing to some /etc/systemd/system path and enable it. Also skim through it and correct paths and requirements maybe.

Example usage (for which these scripts/services were actually written) - caching of passphrase (or hardware-generated key) for encrypted (dm-crypt) disks with dracut/systemd. Idea is to use RSA key on a smartcard token to produce key for dm-crypt (or just cache what is entered interactively, as plymouth does), then use it repeatedly for every encrypted lvm partition systemd tries to unlock, not just root.

(more info on how this particular setup works can be found here)

systemd-password-agent's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ein-shved

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.