Skip to content

Getting Started

Anton edited this page Apr 23, 2022 · 17 revisions

Dependencies

  • bash >= 3.0

Password encryption:

  • gpg or gpg2

Clipboard support:

  • xclip

Synchronization support:

  • rsync
  • openssh

Installation

Generating your GPG key

Before you install BashPass, you'll have to generate a GPG key. Run the following command in your terminal to start key generation process.

$ gpg --full-generate-key

Once you run this command, you'll be asked to select a encryption protocol. Select the first option (RSA).

Please select what kind of key you want:
   (1) RSA and RSA
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
   (9) ECC (sign and encrypt) *default*
  (10) ECC (sign only)
  (14) Existing key from card
Your selection? 1

Now you'll be prompted to choose a keysize. The default option (3072) is fine.

RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (3072)
Requested keysize is 3072 bits

After selecting the keysize, you'll be asked how long you want the key to be valid. The default option 1 (key does not expire) is fine.

Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0)
Key does not expire at all
Is this correct? (y/N) y

Now it's time to set a name for the key. This can be anything (example: BashPass).

Real name: Bashpass

Once you've set a name for the key, it's time to set the email address, this is important to remember, you'll need this later to configure BashPass.

Email address: example@gmail.com

The final step to generate your GPG key is to set a comment, this isn't needed but can be useful in case you have more than one GPG key on your computer. After this just confirm the settings and you're done.

Comment: BashPass encryption key

Now your key will be generated. Once this is done you'll see something like this:

pub   rsa3072 2022-04-22 [SC]
      86F27E3CAA49BB273653B39763BBB2BD91082EE1
uid           [ultimate] Bashpass (Key to use BashPass) <example@gmail.com>
sub   rsa3072 2022-04-22 [E]

Note you can see the key fingerprint (86F27E3CAA49BB273653B39763BBB2BD91082EE1), this string contains the key ID. This are the last 8 characters (91082EE1) of the fingerprint. This part is important to remember, you'll need this later to configure BashPass.

Running the installer

Once you have generated your GPG key, it's time to install BashPass. For this you can clone the repo and run the install.sh script or the simple one-liner below. This command will download the latest version of BashPass and install it for you.

$ bash -c "$(wget -qO - https://raw.githubusercontent.com/AntonVanAssche/BashPass/master/scripts/install.sh)"

After installation, you'll have to add .local/bin to your PATH to use BashPass. Add the following line in your .bashrc file.

export PATH="$HOME/.local/bin:$PATH"

When you start BashPass for the first time you'll be prompted with the question to enter the name of the GPG key you want to use. After entering the name a you'll be asked to enter the e-mail address you've used to generate the key.

Enter the key ID of the GPG key you want to use: 91082EE1
Enter the email address you created the gpg key with: example@gmail.com

Basic usage

Updating

To update BashPass to the latest version, you can clone the repo and run the update.sh script or the simple one-liner below.

$ bash -c "$(wget -qO - https://raw.githubusercontent.com/AntonVanAssche/BashPass/master/scripts/update.sh)"

Uninstalling

To uninstall BashPass, you can clone the repo and run the uninstall.sh script or the simple one-liner below.

$ bash -c "$(wget -qO - https://raw.githubusercontent.com/AntonVanAssche/BashPass/master/scripts/uninstall.sh)"
Clone this wiki locally