Giter VIP home page Giter VIP logo

chpass's Introduction

chpass

A script for my own convenience to change all my passwords. It changes the passphrases of my current user, root, my SSH key, my LUKS GPG key, and my personal GPG key. Prefix a space before running this command to avoid storing your passwords in your shell history.

Full disclosure

I'm not a developer by any means, and you may find this repository a comical attempt to change passphrases. And you're probably right, so feel free to:

  1. Not use it;
  2. Show me how to make it better (you are encouraged!).

Usage

$ ./chpass.sh -h 
chpass, version 0.1
Usage: ./chpass.sh -o OLD_PASS -n NEW_PASS [option] ...

  -h, --help            display this help and exit
  -o, --old-passphrase  specify your old passphrase (e.g. 
                        correcthorsebatterystaple)
  -n, --new-passphrase  specify your new passphrase (e.g. 
                        correcthorsebatterystaple)

Options:
  -u, --username        override user name (e.g. larry). Otherwise 
                        we assume user who called script.
  -l, --login           change login passphrase
  -r, --root            change root's passphrase
  -s, --ssh-key         specify your SSH key to change your 
                        passphrase of (e.g. ~/.ssh/id_ed25519)
  -L, --luks-gpg-key    specify your LUKS GPG key in /boot to change 
                        your passphrase of (e.g. /boot/root.gpg)
  -g, --gpg-key-id      specify your GPG key ID to change your 
                        passphrase of (e.g. 
                        26D3D565A520CC894E457D0F5922172F920C075A). 
                        does not work with --old-passphrase, or 
                        --new-passphrase and will prompt for both.

Example

$  sudo ./chpass.sh -o 'oldpass' -n 'newpass' -l -r -s ~/.ssh/id_ed25519 \
  -L /boot/root.gpg

 * Changing user passwd ...                                 [ ok ]
 * Changing root passwd ...                                 [ ok ]
 * Changing SSH key passwd ...                              [ ok ]
 * Changing LUKS key passwd ...                             [ ok ]

Changing passphrases complete.

Dependencies

  1. bash (app-shells/bash);
  2. coreutils (sys-apps/coreutils);
  3. gpg (app-crypt/gnupg);
  4. openssh (net-misc/openssh);
  5. shadow (sys-apps/shadow).

To do

  1. Figure out a way to change personal GPG key non-interactively. Couldn't get it to work with gpg itself, gpg-agent (pinentry loopback), nor expect.

chpass's People

Contributors

gkroon avatar

Stargazers

 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.