Set up KeePass Auto-Type on Linux

If you’ve used KeePass on Windows you may be very attached to its auto-type feature, where with a single key-combo press the application with magically type your user name and password into the website or application you’re trying to use. This is super handy and something that is sadly missing by default on Linux. Thankfully its also very easy to make work on Linux.

1. Start by installing the xdotool package

On Debian/Ubuntu/etc simply run:

sudo apt-get install xdotool

2. Next find out where the keepass2 executable is installed on your system

The easiest way to do this is to run:

which keepass2

On my system this returns /usr/bin/keepass2. This file is actually not the program itself but a script that bootstraps the program. So to find out where the real executable run:

cat /usr/bin/keepass2

On my system this returns

#!/bin/sh
exec /usr/bin/cli /usr/lib/keepass2/KeePass.exe "$@"

So the program itself is actually located at /usr/lib/keepass2/KeePass.exe.
3. Create a custom keyboard shortcut

linuxmintkeyboardshortcut

The process for this will differ depending on which distribution you’re running but it’s usually under the Keyboard settings. For the command enter the following:

mono /usr/lib/keepass2/KeePass.exe --auto-type

Now whenever you key in your shortcut keyboard combo it will tell KeePass to auto-type your configured username/password/whatever you setup in KeePass. The only catch is that you must first open KeePass and unlock your database.



7 Comments

  1. Thx for your help.

    You must update your first step for Debian/Ubuntu, cuz not work.

    xdotool :
    Debian and Ubuntu users can install xdotool with: apt-get install xdotool
    (Note: you will get a pretty ancient version of xdotool, if you want newer ones check here)

    Source : http://www.semicomplete.com/blog/projects/xdotool/#idp17232

    So, install :
    – libxdo2 2.20110530.1 ubuntu/64bit
    – xdotool_2.20110530.1-1_x86_64.deb
    Source : http://code.google.com/p/semicomplete/downloads/list?can=2&q=label:deb+label:xdotool+label:featured&colspec=Filename+Summary+Uploaded+Size+DownloadCount

    Then, follow your tutorial, step 2.

    Tested on Debian, it’s work very well.

  2. Thank you, I’ve been Googling to figure out my Keepass autotype issue on 22.04 and this was the only solution. For the xdotool install
    sudo apt update
    sudo apt -y install xdotool

    not sure f it’s the latest xdotool version, but Keepass is happy.

    Thank you

  3. These days I highly recommend just using KeePassXC. It’s a native application and auto-type just works without any messing around.

2 Trackbacks / Pingbacks

  1. Top 5 posts of 2017 – #2: Set up KeePass Auto-Type on Linux – The Linux Experiment
  2. The Linux Experiment Post Roundup (October 2014) | Tyler Burton

Leave a Reply

Your email address will not be published.


*