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

Generate SSH Key

Harsh Shandilya edited this page Apr 26, 2020 · 7 revisions

Generate a ssh key for your git repo

From the application

  • Go to Settings > Generate SSH key pair
  • Select the key size (length)
  • Set the passphrase (optional) and a comment (optional)
  • Press Generate
  • Press Copy to copy the public key and add it to your ssh server

From a terminal

  • Generate the private and public key:
ssh-keygen -C droid_phone -b 4096 -t rsa -m PEM -f /tmp/id_rsa_droid
  • Copy the public key /tmp/id_rsa_droid.pub on your ssh server and add in to the ~/.ssh/authorized_keys file:
cat id_rsa_droid.pub >> ~/.ssh/authorized_keys
  • Copy the private key /tmp/id_rsa_droidto your phone and import it in your Password Store app through the settings.

From OpenKeychain

  • Generate or import a GPG key as normal in OpenKeychain
  • Check if there is already an authentication sub-key by opening the relevant key, then navigating to the "Advanced" menu > "Subkeys" tab. The icon for authentication looks like an ID card.
  • If necessary, generate a new authentication subkey by clicking the "Edit" (pencil) button > "Add" (blue plus), and selecting "Authentication" for the usage. Click "OK" then "Save" (in the top right) if everything looks good.
  • You may then obtain the public key by clicking one of the "Share as SSH public key" buttons on the "Share" tab. This is what you need to add to your ~/.ssh/authorized_keys file, as a new line
  • To log in using the private key, select "OpenKeychain" as your authentication mode when cloning, then select your GPG key when prompted.
Clone this wiki locally