Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Setting up Password Store to sync with a local computer

Harsh Shandilya edited this page May 2, 2020 · 8 revisions

Git is flexible in the way that all installations are both clients as well as servers and thus we can simply clone repositories present on a local network or filesystem as we from a remote server like a Git hosting service. To setup a local PC so that it can be accessed by Password Store, you'll need the following things installed, available from any of the many package managers across different operating systems and Linux flavors.

  • OpenSSH
  • Git
  • GnuPG

Steps

Generate a gpg key

gpg2 --full-gen-key

Install pass

Download it from this website

Initialize pass

pass init <email used for the GPG key in the previous step>

Setup git

Setup both pass as well as a git repository that will be used by Password Store.

sudo apt-get install openssh-client openssh-server
git init --bare ~/pass-repo
pass git init
pass git remote add origin ssh://oren@localhost:/home/oren/pass-repo
pass git push origin master

Generate a set of OpenSSH keys

Unfortunately, Password Store can't support many new key ciphers so we're stuck with 4096-bit RSA as the strongest supported cipher. Don't save these keys in your ~/.ssh directory, since we do not want the PC to use this when authenticating with other servers, it just needs to authorize this pair to connect to it.

$ ssh-keygen -m PEM -t rsa -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/home/msfjarvis/.ssh/id_rsa): pass_store
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in pass_store.
Your public key has been saved in pass_store.pub.
The key fingerprint is:
SHA256:C5+Ypk1/tCiBZM8QaSGArJmakMCHcdtVHeDSMct/Whw msfjarvis@ryzenbox
The key's randomart image is:
+---[RSA 4096]----+
|=o+..o ..=o..    |
|o+.o* . + +.     |
|o+.o o . =   E   |
|*   +   . . . .  |
|o. o =. S  . +   |
|o   . += o. +    |
|      =.+o o     |
|     =... o      |
|    . ....       |
+----[SHA256]-----+

$ ls
pass_store pass_store.pub

Authorize the SSH key

Place the public part of the keypair in OpenSSH's authorized_keys file so that you can connect to the computer with this key.

cat pass_store.pub >> ~/.ssh/authorized_keys

Set the server config in Password Store

Select Clone from server in the setup screen, then fill in the entries as given below.

Field Value
Username your username on the computer
Server URL local IP of the computer. Generally starts with 192.168.0
Port 22 by default, depends on your OpenSSH configuration
Repo path absolute location of the git repo
Authentication mode SSH key

Import the SSH key in Password Store

Push the SSH key to your device using the commands below. ADB can be found in the android-tools-adb package in Ubuntu and similarly named ones in other Linux distributions. Ensure your device is not connected in Charge only mode and that USB debugging is enabled (searching around will give you millions of results on how to do that).

adb push pass_store /sdcard/
adb shell chmod 644 /sdcard/pass_store

Open up Password Store, go to settings, then click Import SSH key and select pass_store from the root of your internal storage. Once done, delete the file from your device using a file manager application or this command in your computer.

adb shell rm /sdcard/pass_store

Clone

Select clone from the server config page and in a few seconds you should be greeted with a list of your passwords.