Setup pass on your Android

1. Setup git

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 --set-upstream

Explanation: these commands create a git repository that stores the encrypted passwords. The repository is located at ~/pass-repo and is needed in order to allow your phone to pull and push passwords.

Line by line:

2. Generate a set of OpenSSH keys

ssh-keygen -t rsa -b 4096
Enter file in which to save the key (/home/msfjarvis/.ssh/id_rsa): pass_store

Explanation: this command create two files: pass_store and pass_store.pub. Those are SSH keys that allow your phone to authenticate with your laptop

3. Copy the public SSH key to authorized_keys

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

Explanation: adding the public ssh key to the authorized_keys file will allow your phone (which will have the private key) to authenticate with your laptop

5. Copy the private SSH key to your phone

sudo apt-get install android-tools-adb
adb push pass_store /sdcard/
adb shell chmod 644 /sdcard/pass_store

Explanation: adb push copy the private SSH key to your phone. /sdcard/ on Android is a symlink to internal storage so you can push to it without needing to poke into /mnt

6. Use the SSH key in the Password Store app

Remove the key from your phone

adb shell rm /sdcard/pass_store

7. Connect the Password Store app to the git repository on your laptop

Fill-in the server info:

Username: oren (my laptop's user)
Server URL: 192.168.0.104 (my laptop's url)
Port: 22
Repo path: /home/oren/pass-repo (path to the bare repo)

Keep the Protocol (ssh) and Authentication Mode (ssh key) the same.

8. Use the gpg key in the OpenKeychain app

gpg2 --export-secret-keys > secret.gpg
adb push secret.gpg /sdcard/

Explanation: this is the same key that you use to convert your plaintext password to the encrypted data. You need to use it in the mobile app.

9. Change a setting of OpenKeychain

Settings -> Apps -> Permissions -> Other Permissions -> OpenKeychain -> Enable Display pop-up windows while running in the background

Explanation: without this settings the mobile app won't be able to show you the passwords.

10. Setup the mobile app

Explanation: copy the .password-store folder is needed because I am having issues with the official git clone approach.