Coder Social home page Coder Social logo

pa's Introduction

password ass (pa)

A simple password manager using age written in POSIX sh. Based on pash by dylanaraps.

  • Automatically generates an age key if one is not detected.
  • Written in safe and shellcheck compliant POSIX sh.
  • Only 120~ LOC (minus blank lines and comments).
  • Configurable password generation using /dev/urandom.
  • Guards against set -x, ps and /proc leakage.
  • Easily extendible through the shell.
  • Ability to edit passwords using $EDITOR

Table of Contents

Dependencies

  • age

Usage

Examples: pa add web/gmail, pa list, pa del facebook, pa show github, pa edit sourcehut.

USAGE

pa 0.1.0 - age-based password manager
=> [a]dd  [name] - Create a new password, randomly generated
=> [d]el  [name] - Delete a password entry.
=> [e]dit [name] - Edit a password entry with vim.
=> [l]ist        - List all entries.
=> [s]how [name] - Show password for an entry.
Password length:   export PA_LENGTH=50
Password pattern:  export PA_PATTERN=_A-Z-a-z-0-9
Store location:    export PA_DIR=~/.local/share/pa

FAQ

How does this differ from pass or etc?

I was looking for a shell-based password manager that used age. Actually, see my blog post if you're really that curious:

https://j3s.sh/thoughts/storing-passwords-with-age.html

Where are passwords stored?

The passwords are stored in age encrypted files located at ${XDG_DATA_HOME:=$HOME/.local/share}/pa}.

How do I change the password store location?

Set the environment variable PA_DIR to a directory.

# Default: '~/.local/share/pa'.
export PA_DIR=~/.local/share/pa

# This can also be used as a one-off.
PA_DIR=/mnt/drive/pa pa list

How do I rename an entry?

It's a file! Standard UNIX utilities can be used here.

How can I extend pa?

A shell function can be used to add new commands and functionality to pa. The following example adds pa git to execute git commands on the password store.

pa() {
    case $1 in
        g*)
            cd "${PA_DIR:=${XDG_DATA_HOME:=$HOME/.local/share}/pa}"
            shift
            git "$@"
        ;;

        *)
            command pa "$@"
        ;;
    esac
}

pa's People

Contributors

biox avatar tgharib avatar

Watchers

 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.