Skip to content

Instantly share code, notes, and snippets.

@adriaPerez
Last active November 24, 2018 12:45
Show Gist options
  • Save adriaPerez/81c3cadb08102dd7ce8acbb1f767e220 to your computer and use it in GitHub Desktop.
Save adriaPerez/81c3cadb08102dd7ce8acbb1f767e220 to your computer and use it in GitHub Desktop.
Setup pass storage and remote git sync

Setup pass with git

  1. Install pass utility

    sudo pacman -S pass
  2. Create a GPG key using the default RSA also (if not yet created)

    gpg --full-gen-key
  3. Use the returned GPG Key Id to init the pass storage (if you already had one you can retrieve it using gpg --list-secret-keys)

    pass init GPG_KEY_ID
  4. Sync the pass storage with a remote git repository

    pass git init
    pass git remote add origin example.com:pass
    pass git push

Using pass on another machine

  1. Export your GPG key from your original machine:
    gpg --export-secret-keys --armor GPG_KEY_ID > privkey.asc
    gpg --export --armor GPG_KEY_ID > pubkey.asc
  2. Import your GPG key on the new machine:
    gpg --import /path/to/pubkey.asc
    gpg --allow-secret-key-import --import /path/to/privkey.asc
  3. Trust it if necessary:
    gpg --edit-key GPG_KEY_ID
  4. Install pass utility if not already installed:
    sudo pacman -S pass
  5. Make your repository the new pass store:
    rm -rf ~/.password-store
    git clone user@server:repository.git ~/.password-store
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment