A Python utility that helps you securely connect to SSH servers using credentials stored in a KeePass database
Project description
KeePass SSH Connect
A Python utility that helps you securely connect to SSH servers using credentials stored in a KeePass database. This tool provides a convenient way to manage and use your server credentials while keeping them secure.
Features
- 🔐 Securely store SSH server credentials in KeePass
- 🚀 Easy command-line interface for server connections
- 🔍 Flexible server filtering and selection
- 📋 List and manage server entries
- 🔑 Support for key files and environment variables
Installation
Install using pip:
pip install keepass-ssh-connect
Prerequisites
- Python 3.8+
- KeePass database with SSH server entries
- Required Python packages (installed automatically):
- pykeepass
- paramiko
- python-dotenv
- colorama
Usage
Basic Usage
# List all servers
keepass-ssh-connect -l
# Connect to a specific server
keepass-ssh-connect -s "production"
# Specify database and group
keepass-ssh-connect -d /path/to/database.kdbx -g "/Servers/Production"
Full CLI Options
usage: keepass-ssh-connect [-h] [-d DATABASE] [-k KEY_FILE] [-g GROUP]
[-s SERVER] [-l] [-v]
KeePass SSH Connection Utility
optional arguments:
-h, --help show this help message and exit
-d DATABASE, --database DATABASE
Path to the KeePass database file
-k KEY_FILE, --key-file KEY_FILE
Path to the KeePass key file (optional)
-g GROUP, --group GROUP
KeePass group path to filter server entries
-s SERVER, --server SERVER
Specific server name or partial match to connect to
-l, --list List available servers without connecting
-v, --verbose Enable verbose output
Environment Variables
You can also use environment variables for default settings:
KEEPASS_DB_PATH: Path to the KeePass databaseKEEPASS_KEY_PATH: Path to the key fileKEEPASS_GROUP_PATH: Default group path for server entries
Local File Discovery
If no database path is specified through command-line parameters or environment variables, the utility will automatically search the current directory for KeePass files:
- It looks for
.kdbxfiles for the database - It looks for
.keyxfiles for the key file
When local files are discovered, the utility will print the paths of the files being used, helping you understand which files are being automatically selected.
Example
# If you have 'mypasswords.kdbx' and 'mykey.keyx' in the current directory
keepass-ssh-connect
# This will print:
# Using local database file: mypasswords.kdbx
# Using local key file: mykey.keyx
Note: Local file discovery provides convenience but should be used carefully to avoid unintended file selection.
Configuration in KeePass
- Create a group for SSH servers
- For each server, add an entry with:
- Title: Server name
- Username: SSH username
- Password: SSH password
- URL: Server hostname or IP
- Notes: Additional connection details
Security
- Credentials are never stored in plain text
- Supports KeePass key files for additional security
- Uses environment variables to avoid hardcoding sensitive information
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file keepass_ssh_connect-0.1.0.tar.gz.
File metadata
- Download URL: keepass_ssh_connect-0.1.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.9.5 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d65b229e2be0eb25a306f0fba4414a10b7946541af4a9afab4df1dacd895026f
|
|
| MD5 |
6505a29cab889a112044b825113cd741
|
|
| BLAKE2b-256 |
4ddc59a896fab1cfe7b7ea16a73f58d7b76c5fa56e646569de502138233b8d2d
|
File details
Details for the file keepass_ssh_connect-0.1.0-py3-none-any.whl.
File metadata
- Download URL: keepass_ssh_connect-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.9.5 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a45abfa4f25909cadd71cee7c11cdcd5f7df1a666705af15fbdf0a9909310a9
|
|
| MD5 |
e51f7bffefd6908560bdebab7c450fbc
|
|
| BLAKE2b-256 |
4d2f00154a70146b5c64a27826e4b2480187549f191e13c03d70282601189429
|