Skip to content

Latest commit

 

History

History
386 lines (257 loc) · 14.1 KB

setup.md

File metadata and controls

386 lines (257 loc) · 14.1 KB

Setup

Table of Contents

  1. Pre-Installation Steps
  2. Installation Steps
  3. Optional Post-Installation Steps
  4. Using gopass

Pre-Installation Steps

Download and Install Dependencies

gopass needs some external programs to work:

  • gpg - GnuPG, preferably in Version 2 or later
  • git - Git SCM, any Version should be OK

It is recommended to have either rng-tools or haveged installed to speed up key generation if these are available for your platform.

Ubuntu & Debian

apt-get install gnupg git rng-tools

Note: installing in Ubuntu 16.04 will require you to install gnupg2.

RHEL & CentOS

yum install gnupg2 git rng-tools

Arch Linux

pacman -S gnupg2 git rng-tools

MacOS

If you haven't already, install homebrew. And then:

brew install gnupg2 git

Windows

Alternatively, it can be installed via chocolatey

  • choco install gopass (requires admin privileges)

OpenBSD

For OpenBSD -current:

pkg_add gopass

For OpenBSD 6.2 and earlier, install via go get.

Please note that the OpenBSD builds uses pledge(2) to disable some syscalls, so some features (e.g. version checks, auto-update) are unavailable.

Set up a GPG key pair

gopass depends on the gpg program for encryption and decryption. You must have a suitable key pair. To list your current keys, you can do:

gpg --list-secret-keys

If there is no output, then you don't have any keys. To create a new key:

gpg --gen-key

For macOS you have to use the following to get all options

gpg --full-generate-key

You will be presented with several options:

  • Key type: Choose either "RSA and RSA" or "DSA and ElGamal".
  • Key size: Choose at least 2048.
  • Validity: 5 to 10 years is a good default.
  • Enter your real name and primary email address.
  • A comment is not necessary.
  • Pass phrase: Make sure to pick a very long pass phrase, not just a simple password. Remember this should be stronger than any of the secrets you store in the password store. You can configure the GPG Agent later to save you repetitive typing.

Now, you have created a public and private key pair. If you don't know what that means, or if you are not familiar with GPG, we highly recommend you do a little reading on the subject. Check out the following manuals:

Git and GPG

gopass will configure git to sign commits by default, so you should make sure that git can interface with GPG.

mkdir some-dir
cd some-dir
git init
touch foo
git add foo
git commit -S -m "test"

If the last step fails please investigate this before continuing.

Installation Steps

Depending on your operating system, you can either use a package manager, download a pre-built binary, or install from source. If you have a working Go development environment, we recommend building from source.

MacOS

If you haven't already, install homebrew. And then:

brew install gopass

Alternatively, you can install gopass from the appropriate Darwin release from the repository releases page.

If you're using a password on your gpg key, you also have to install pinentry-mac from brew and configure it in your ~/gpg/gpg-agent.conf

brew install pinentry-mac
echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf

Ubuntu & Debian

WARNING: The official Debian repositories contain a package named gopass that is not related to this project in any way. It's a similar tool with a completely independent implementation and feature set. We are aware of this issue but can not do anything about it.

When installing on Ubuntu or Debian you can either download the deb package and install manually or use our repository.

Manual download

First, find the latest .deb release from the repository releases page. Then, download and install it:

wget [the URL of the latest .deb release]
sudo dpkg -i gopass-1.2.0-linux-amd64.deb

Gentoo

There is an overlay that includes gopass. Run these commands to install gopass through emerge.

layman -a go-overlay
emerge -av gopass

RedHat / CentOS

There is an unofficial RPM build maintained by a contributor.

# if you're using dnf (needs dnf-plugins-core)
dnf copr enable daftaupe/gopass
dnf install gopass
# of if you're using an older distribution (needs yum-plugin-copr)
yum copr enable daftaupe/gopass
yum install gopass

Arch Linux

pacman -S gopass

Windows

WARNING: Windows is not yet officially supported. We try to support it in the future. These are steps are only meant to help you setup gopass on Windows so you can provide us with feedback about the current state of our Windows support.

You can install gopass by Chocolatey:

choco install gopass

Or by Scoop:

scoop install gopass

Alternatively, download and install a suitable Windows build from the repository releases page.

Installing from Source

If you have Go already installed, you can use go get to automatically download the latest version:

go get -u github.com/gopasspw/gopass

If $GOPATH/bin is in your $PATH, you can now run gopass from anywhere on your system.

Optional Post-Installation Steps

Securing Your Editor

Various editors may store temporary files outside of the secure working directory when editing secrets. We advise you to check and disable this behavior for your editor of choice.

For vim on Linux, the following setting may be helpful:

au BufNewFile,BufRead /dev/shm/gopass.* setlocal noswapfile nobackup noundofile

Migrating from pass to gopass

If you are migrating from pass to gopass, you can simply use your existing password store and everything should just work. Furthermore, it may be helpful to link the gopass binary so that you can use it as a drop-in replacement. For example, assuming $HOME/bin/ exists and is present in your $PATH:

ln -s $GOPATH/bin/gopass $HOME/bin/pass

Migrating to gopass from Other Password Stores

Before migrating to gopass, you may have been using other password managers (such as KeePass, for example). If you were, you might want to import all of your existing passwords over. Because gopass is fully backwards compatible with pass, you can use any of the existing migration tools found under the "Migrating to pass" section of the official pass website.

Enable Bash Auto completion

If you use Bash, you can run one of the following commands to enable auto completion for sub-commands like gopass show, gopass ls and others.

source <(gopass completion bash)

MacOS: The version of bash shipped with MacOS may require a workaround to enable auto completion. If the instructions above do not work try the following one:

source /dev/stdin <<<"$(gopass completion bash)"

Enable Z Shell Auto completion

If you use zsh, make install or make install-completion should install the completion in the correct location.

If zsh autocompletion is still not functional, or if you want to install it manually, you can run the following commands:

$ gopass completion zsh > ~/_gopass 
$ sudo mv ~/_gopass /usr/share/zsh/site-functions/_gopass
$ rm -i ${ZDOTDIR:-${HOME:?No ZDOTDIR or HOME}}/.zcompdump && compinit

Then exit and re-run zsh if the last command failed.

Notice that it is important to directly redirect Gopass' output to a file, using pipes or echo mess up the output. Also notice that the generated _gopass file is a completion file that is supposed to be handled by zsh and to be installed in the zsh completions directory, as defined by either the standard /usr/share/zsh/site-functions/ path, or by a user-specified fpath folder. It is not meant to used with source.

If zsh completion is still not working, you might want to add the following to your .zshrc file:

autoload -U compinit && compinit

if you don't have it already.

Enable fish completion

If you use the fish shell, you can enable experimental shell completion by the following command:

$ mkdir -p ~/.config/fish/completions and; gopass completion fish > ~/.config/fish/completions/gopass.fish

and start a new shell afterwards.

Since writing fish completion scripts is not yet supported by the CLI library we use, this completion script is missing a few features. Feel free to contribute if you want to improve it.

dmenu / rofi support

In earlier versions gopass supported dmenu. We removed this and encourage you to call dmenu yourself now.

This also makes it easier to call gopass with any drop-in replacement of dmenu, like rofi, for example, since you would just need to replace the dmenu call below by rofi -dmenu.

# Simply copy the selected password to the clipboard
gopass ls --flat | dmenu | xargs --no-run-if-empty gopass show -c
# First pipe the selected name to gopass, encrypt it and type the password with xdotool.
gopass ls --flat | dmenu | xargs --no-run-if-empty gopass show -f | head -n 1 | xdotool type --clearmodifiers --file -

You can then bind these command lines to your preferred shortcuts in your window manager settings, typically under System Settings > Keyboard > Shortcuts > Custom Shortcuts. In some cases you may need to wrap it with bash -c 'your command' in order for it to work (tested and working in Ubuntu 18.04).

Filling in passwords from browser

Gopass allows filling in passwords in browsers leveraging a browser plugin like gopass bridge. The browser plugin communicates with gopass via JSON messages. To allow the plugin to start gopass, a native messaging manifest must be installed for each browser. Chrome, Chromium and Firefox are supported, currently. Further a wrapper must be installed to setup gpg-agent and execute gopass-jsonapi listen.

Upgrade to gopass v1.10: gopass-jsonapi is now a separate binary file, which you might need to install separately. The new binary can also be downloaded and unpacked from the latest archive files on Github Releases. You need to run gopass-jsonapi configure after the upgrade to configure your browser for the new command.

# Asks all questions concerning browser and setup
gopass-jsonapi configure

# Do not copy / install any files, just print their location and content
gopass-jsonapi configure --print

# Specify browser and wrapper path
gopass-jsonapi configure --browser chrome --path /home/user/.local/

The user name/login is determined from login, username and user yaml attributes (after the --- separator) like this:

<your password>
---
username: <your username>

As fallback, the last part of the path is used, e.g. theuser1 for Internet/github.com/theuser1 entry.

Windows: The jsonapi setup copies the current gopass-jsonapi binary as a wrapper executable file (gopass_native_host.exe calls the listener directly). It is recommended to run gopass-jsonapi configure after each update to have the latest version setup for your browser. The global setup requires to run gopass-jsonapi configure as Administrator.

Storing and Syncing your Password Store with Google Drive / Dropbox / etc.

Please be warned that using cloud-based storage may negatively impact to confidentially of your store. However, if you wish to use one of these services, you can do so.

For example, to use gopass with Google Drive:

gopass init --rcs noop
mv .password-store/ "Google Drive/Password-Store"
gopass config path "~/Google Drive/Password-Store"

Download a GUI

Because gopass is fully backwards compatible with pass, you can use some existing graphical user interfaces / frontends:

There is also Gopass UI which was exclusively implemented for gopass and is available for MacOS, Linux and Windows.

Others can be found at the "Compatible Clients" section of the official pass website.

Using gopass

Once you have installed gopass, check out the features documentation for some quick usage examples.

Using the onboarding wizard

Running gopass with no existing store will start the onboarding wizard which will guide you through the setup of gopass.

Batch bootstrapping

In order to simplify the setup of gopass for your team members it can be run in a fully scripted bootstrap mode.

# First initialize a new shared store and push it to an empty remote
gopass --yes setup --remote github.com/example/pass.git --alias example --create --name "John Doe" --email "[email protected]"

# For every other team member initialize a new store and clone the existing remote
gopass --yes setup --remote github.com/example/pass.git --alias example --name "Jane Doe" --email "[email protected]"