User Tools

Site Tools


config:keepass

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
config:keepass [2016/07/10 21:00] Wulf Rajekconfig:keepass [2023/07/06 13:19] (current) Wulf Rajek
Line 1: Line 1:
 ====== Keepass2 ====== ====== Keepass2 ======
  
-Main Windows Download link (Pro version) can be found here:\\ +KeePass is a the free, open source, light-weight and easy-to-use password manager/password safe.
-http://keepass.info/download.html+
  
-It can be installed under linux using+It can be installed under ubuntu/mint using
 <code> <code>
-apt-get install keepass2+sudo add-apt-repository ppa:ubuntuhandbook1/keepass2 
 +sudo apt update 
 +sudo apt-get install keepass2 ca-certificates 
 </code> </code>
 +
 +Uninstall instructions:
 +<code>
 +sudo apt remove --autoremove keepass2
 +sudo add-apt-repository --remove ppa:ubuntuhandbook1/keepass2
 +</code>
 +
 +===== Keepass2.exe.config error =====
 +<code>
 +sudo apt-get install mono-utils
 +monodis --assembly /usr/lib/keepass2/KeePass.exe | grep Version | sed 's|Version:\ *\([0-9\.]*\)$|\1|'
 +sudo vi /usr/lib/keepass2/KeePass.exe.config
 +#replace newVersion number in file
 +
 +Oneliner:
 +sudo sed -i 's/newVersion="\([0-9\.]*\)"/newVersion='$(monodis --assembly /usr/lib/keepass2/KeePass.exe | grep Version | sed 's|Version:\ *\([0-9\.]*\)$|\"\1|')'\"/' /usr/lib/keepass2/KeePass.exe.config
 +</code>
 +
 +Auto patching of config file, create shell script and apt pre-inst hook (no post inst hook available as per https://askubuntu.com/questions/869219/how-can-i-run-a-script-after-a-specific-package-is-upgraded):
 +<code bash /usr/local/bin/fix-keepass2-config.sh>
 +#!/bin/bash
 +if grep -q keepass2
 +then
 +    if [ ! -f /usr/bin/monodis ]
 +    then
 +        echo "monodis is required to fix the keepass2 config file."
 +        echo "Please install it via apt-get install mono-utils"
 +        exit 1
 +    else 
 +        echo "Scheduling config update for keepass2 in 5 minutes..."
 +        (
 +        sleep 300;
 +        sed -i 's/newVersion="\([0-9\.]*\)"/newVersion='$(monodis --assembly /usr/lib/keepass2/KeePass.exe | grep Version | sed 's|Version:\ *\([0-9\.]*\)$|\"\1|')'\"/' /usr/lib/keepass2/KeePass.exe.config
 +        ) &
 +    fi
 +fi
 +</code>
 +<code - /etc/apt/apt.conf.d/99-keepass2-hook>
 +DPkg::Pre-Install-Pkgs {"/usr/local/bin/fix-keepass2-config.sh";};
 +DPkg::Tools::Options::/usr/local/bin/fix-keepass2-config.sh::Version "1";
 +</code>
 +<code>
 +sudo chmod 755 /usr/local/bin/fix-keepass2-config.sh
 +</code>
 +
 +===== Manual update to latest Windows version =====
 +
 +The keepass2 PPAs have not been updated for quite a while. To use the latest version, follow these instructions (after installing the PPA version):
 +
 +  * Download the portable version zip file from official link https://keepass.info/download.html
 +  * Close the KeePass2 application
 +  * Make a copy of the /usr/lib/keepass2 folder as backup
 +  * Unzip the portable version and copy the file KeePass.exe to /usr/lib/keepass2 as root
 +
  
 ===== Plugins under Linux ===== ===== Plugins under Linux =====
Line 28: Line 83:
 </code> </code>
  
 +
 +===== Google Drive Sync =====
 +<code>
 +apt install golang
 +
 +vi ~/.bashrc
 +export GOPATH=$HOME/gopath
 +export PATH=$GOPATH:$GOPATH/bin:$PATH
 +
 +source ~/.bashrc
 +
 +go get -u github.com/odeke-em/drive/cmd/drive
 +
 +mkdir ~/gdrive
 +drive init ~/gdrive
 +open url, log into google, authorise drive, copy and paste authorization code.
 +
 +
 +cd ~/gdrive
 +drive pull Wulf.kdbx
 +
 +mkdir ~/KeePass/
 +</code>
 +
 +vi ~/KeePass/keepass_trigger_load.sh
 +<code>
 +#!/bin/bash
 +cd ~/gdrive
 +drive pull -ignore-conflict -quiet Wulf.kdbx
 +</code>
 +
 +vi ~/keepass_trigger_save.sh:
 +<code>
 +#!/bin/bash
 +cp ~/KeePass/Wulf.kdbx ~/gdrive
 +cd ~/gdrive
 +drive push -ignore-conflict -quiet Wulf.kdbx
 +
 +chmod 777 keepass_trigger_*.sh
 +</code>
 +
 +Keepass Trigger Config "Save to Google Drive" / "Load from Google Drive". Copy the xml to clipboard, then in Keepass go to tools -> triggers -> tools -> Paste from clipboard. Adjust the paths in the triggers.
 +
 +<code>
 +<?xml version="1.0" encoding="utf-8"?>
 +<TriggerCollection xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 + <Triggers>
 + <Trigger>
 + <Guid>DWgF+SL63U+GAsBJQXhahg==</Guid>
 + <Name>Save to Google Drive</Name>
 + <Comments>When the local copy is saved, the server copy will be pulled and synchronized with the local copy. The local copy will then be copied to the local Google Drive folder and pushed to the server.</Comments>
 + <Events>
 + <Event>
 + <TypeGuid>s6j9/ngTSmqcXdW6hDqbjg==</TypeGuid>
 + <Parameters>
 + <Parameter>0</Parameter>
 + <Parameter>/home/wuff/KeePass/Wulf.kdbx</Parameter>
 + </Parameters>
 + </Event>
 + </Events>
 + <Conditions />
 + <Actions>
 + <Action>
 + <TypeGuid>tkamn96US7mbrjykfswQ6g==</TypeGuid>
 + <Parameters>
 + <Parameter />
 + <Parameter>0</Parameter>
 + </Parameters>
 + </Action>
 + <Action>
 + <TypeGuid>2uX4OwcwTBOe7y66y27kxw==</TypeGuid>
 + <Parameters>
 + <Parameter>/home/wuff/KeePass/keepass_trigger_load.sh</Parameter>
 + <Parameter />
 + <Parameter>True</Parameter>
 + <Parameter>0</Parameter>
 + <Parameter />
 + </Parameters>
 + </Action>
 + <Action>
 + <TypeGuid>Iq135Bd4Tu2ZtFcdArOtTQ==</TypeGuid>
 + <Parameters>
 + <Parameter>/home/wuff/gdrive/Wulf.kdbx</Parameter>
 + <Parameter />
 + <Parameter />
 + </Parameters>
 + </Action>
 + <Action>
 + <TypeGuid>2uX4OwcwTBOe7y66y27kxw==</TypeGuid>
 + <Parameters>
 + <Parameter>/home/wuff/KeePass/keepass_trigger_save.sh</Parameter>
 + <Parameter />
 + <Parameter>False</Parameter>
 + <Parameter>0</Parameter>
 + <Parameter />
 + </Parameters>
 + </Action>
 + <Action>
 + <TypeGuid>tkamn96US7mbrjykfswQ6g==</TypeGuid>
 + <Parameters>
 + <Parameter />
 + <Parameter>1</Parameter>
 + </Parameters>
 + </Action>
 + </Actions>
 + </Trigger>
 + <Trigger>
 + <Guid>POhA77GdHU6Hy6Pwl7pf/w==</Guid>
 + <Name>Load from Google Drive</Name>
 + <Comments>When the local copy is opened, the server copy will be pulled and synchronized with the local copy.</Comments>
 + <Events>
 + <Event>
 + <TypeGuid>5f8TBoW4QYm5BvaeKztApw==</TypeGuid>
 + <Parameters>
 + <Parameter>0</Parameter>
 + <Parameter>/home/wuff/KeePass/Wulf.kdbx</Parameter>
 + </Parameters>
 + </Event>
 + </Events>
 + <Conditions />
 + <Actions>
 + <Action>
 + <TypeGuid>tkamn96US7mbrjykfswQ6g==</TypeGuid>
 + <Parameters>
 + <Parameter />
 + <Parameter>0</Parameter>
 + </Parameters>
 + </Action>
 + <Action>
 + <TypeGuid>2uX4OwcwTBOe7y66y27kxw==</TypeGuid>
 + <Parameters>
 + <Parameter>/home/wuff/KeePass/keepass_trigger_load.sh</Parameter>
 + <Parameter />
 + <Parameter>True</Parameter>
 + <Parameter>0</Parameter>
 + <Parameter />
 + </Parameters>
 + </Action>
 + <Action>
 + <TypeGuid>Iq135Bd4Tu2ZtFcdArOtTQ==</TypeGuid>
 + <Parameters>
 + <Parameter>/home/wuff/gdrive/Wulf.kdbx</Parameter>
 + <Parameter />
 + <Parameter />
 + </Parameters>
 + </Action>
 + <Action>
 + <TypeGuid>tkamn96US7mbrjykfswQ6g==</TypeGuid>
 + <Parameters>
 + <Parameter />
 + <Parameter>1</Parameter>
 + </Parameters>
 + </Action>
 + </Actions>
 + </Trigger>
 + </Triggers>
 +</TriggerCollection>
 +</code>
 +
 +
 +
 +====== Install Keepass2 ======
 +
 +Keepass2 is available in the regular debian repositories.
 +
 +<code>
 +sudo apt-get install keepass2 ca-certificates-mono
 +</code>
 +
 +
 +
 +For the Google Sync Plugin, download it from http://keepass.info, then extract the zip file and copy the plgx file into the keepass plugins folder:
 +<code>
 +sudo cp GoogleSyncPlugin.plgx /usr/lib/keepass2/Plugins/
 +sudo chmod 666 /usr/lib/keepass2/Plugins/GoogleSyncPlugin.plgx 
 +</code>
 +
 +
 +
 +===== Google Sync Plugin full install =====
 +<code>
 +cd /tmp
 +wget wget https://sourceforge.net/projects/kp-googlesync/files/GoogleSyncPlugin-2.x/GoogleSyncPlugin-2.1.2.zip
 +unzip GoogleSyncPlugin-2.1.2.zip
 +unzip GoogleSyncPlugin-2.1.2.zip GoogleSyncPlugin.plgx
 +rm GoogleSyncPlugin-2.1.2.zip
 +sudo mkdir -p /usr/lib/keepass2/Plugins/
 +sudo mv GoogleSyncPlugin.plgx /usr/lib/keepass2/Plugins/
 +sudo chmod 666 /usr/lib/keepass2/Plugins/GoogleSyncPlugin.plgx 
 +
 +wget http://mirror.vorboss.net/apache//logging/log4net/binaries/log4net-2.0.8-bin-newkey.zip
 +unzip log4net-2.0.8-bin-newkey.zip
 +sudo cp log4net-2.0.8/bin/mono/2.0/release/log4net.dll /usr/lib/keepass2/
 +sudo chown root:root /usr/lib/keepass2/log4net.dll 
 +sudo chmod 644 /usr/lib/keepass2/log4net.dll
 +sudo cp /usr/lib/mono/2.0/System.ServiceModel.Web.dll /usr/lib/keepass2/
 +sudo chmod 644 /usr/lib/keepass2/System.ServiceModel.Web.dll 
 +</code>
 +set google sync plugin to sync both on saving and opening
 +
 +===== KeeAutoExec plugin =====
 +
 +This plugin automatically opens additional databases.
 +
 +https://keepass.info/plugins.html#keeautoexec
 +
 +Installation:
 +<code>
 +wget https://keepass.info/extensions/v2/keeautoexec/KeeAutoExec-2.6.zip
 +sudo mkdir -p /usr/lib/keepass2/Plugins/
 +sudo unzip KeeAutoExec-2.6.zip -d /usr/lib/keepass2/Plugins/
 +rm KeeAutoExec-2.6.zip
 +</code>
 +Then restart keepass
 +
 +To use:
 +  * Create a new group in your database and name it "AutoOpen" (without the quotes).
 +  * Each non-expired entry in this group corresponds to a database that should be opened automatically when the current database is opened. The fields of each entry specify the following:
 +    * Title: Ignored by the plugin; can be used for comments.
 +    * User name: Must contain the path to the key file, if one should be used. The path can be either absolute or relative to the directory containing KeePass.exe.
 +    * Password: The master password for the database to open. If no password is required, leave this field empty.
 +    * URL: Path to the database file to open. The path can be either absolute or relative to the directory containing KeePass.exe.
 +  * Server credentials. When opening a database from a URL, the credentials for accessing the file on the server can be specified using the custom entry strings "IocUserName" and "IocPassword". These strings must not contain new-line characters.
 +  * Custom entry string "Visible" set to "False" will hide autoopen entries from Menu -> open
 +  * Custom entry string "Focus" set to "Restore" will switch the active tab to the main database again.
config/keepass.1468180836.txt.gz · Last modified: 2023/05/29 11:53 (external edit)