LinuxCommandLibrary

keepass2

Manage passwords securely

TLDR

Start KeePass 2, opening the most recently opened password database

$ keepass2
copy

Start KeePass 2, opening a specific password database
$ keepass2 [path/to/database.kbdx]
copy

Use a specific key file to open a password database
$ keepass2 [path/to/database.kbdx] -keyfile:[path/to/key/file.key]
copy

SYNOPSIS

keepass2 [OPTIONS] [DATABASE_FILE]

PARAMETERS

DATABASE_FILE
    Specifies the path to the KeePass database file (e.g., .kdbx, .kdb) to open upon launch.

--help
    Displays a list of available command-line options and their descriptions.

--version
    Shows the KeePass application version information.

--pw <password>
    Provides the master password for the specified database directly on the command line.
(Warning: This method is insecure as the password can be exposed in system logs or process lists.)

--keyfile <path>
    Specifies the absolute or relative path to the master key file for the database.

--pw-prompt
    Forces the display of the master password and/or key file dialog upon opening the database, even if credentials were provided via other command-line arguments.

--new-instance
    Launches a new, separate instance of KeePass, even if another instance is already running.

--config <path>
    Specifies an alternative configuration file (e.g., KeePass.config.xml) to use instead of the default.

--minimize
    Starts KeePass minimized to the system tray area instead of opening the main window.

--tray
    Starts KeePass in the system tray. When the main window is closed, the application will automatically minimize to the tray instead of exiting.

--entries:<RefID>
    Opens the database and directly selects an entry by its unique reference ID (UUID). This requires the database to be opened successfully first.

DESCRIPTION

KeePass 2 is a free, open-source, cross-platform password manager designed to securely store and manage your digital credentials. It encrypts all your passwords, usernames, URLs, and notes in a single database file, protected by a master password, a key file, or both. On Linux, KeePass 2 typically runs using the Mono framework, which is a free and open-source implementation of Microsoft's .NET Framework. It offers features like strong password generation, auto-typing capabilities for logins, organization of entries into groups, and support for plugins to extend its functionality. Its robust encryption algorithms (AES-256, ChaCha20) ensure the security of your sensitive data.

CAVEATS

KeePass 2 on Linux relies on the Mono runtime; ensure it is properly installed and configured for optimal performance.
Providing sensitive information like the master password directly via command-line arguments using --pw is highly insecure, as it can be visible in process listings (e.g., from ps command) and stored in shell history files. For security, prefer using a key file, or allow KeePass to prompt for credentials via its GUI or --pw-prompt.
While KeePass is cross-platform, some features or plugins might behave differently or require specific configurations on Linux compared to Windows.

RUNNING ON LINUX

The keepass2 command on Linux is often a wrapper script that invokes the KeePass.exe assembly using the mono command. This allows the .NET application to run seamlessly on Unix-like systems. Ensure that the mono-runtime package is installed on your system for KeePass 2 to function correctly.

PLUGIN ARCHITECTURE

KeePass 2 boasts a powerful plugin architecture, allowing users to extend its functionality significantly. Plugins can provide features such as cloud synchronization, browser integration, advanced import/export options, and custom entry fields. These plugins are typically .plgx or .dll files that are placed in the application's plugin directory.

HISTORY

KeePass was originally developed by Dominik Reichl. The first major version, KeePass 1.x (Classic Edition), was written in C++ for Windows. Recognizing the need for cross-platform compatibility, KeePass 2.x (Professional Edition) was rewritten in C# for the .NET Framework, enabling it to run on Linux, macOS, and other platforms via the Mono runtime. First publicly released around 2007, KeePass 2.x quickly gained popularity due to its robust security, open-source nature, and highly extensible plugin architecture, becoming a widely adopted solution for password management across various operating systems.

SEE ALSO

pass(1), gnome-keyring(1), seahorse(1), mono(1)

Copied to clipboard