Skip to content

Instantly share code, notes, and snippets.

@lennyerik
Created January 10, 2025 21:26
Show Gist options
  • Save lennyerik/09d931958b34d3f70dbc7e51aec49af4 to your computer and use it in GitHub Desktop.
Save lennyerik/09d931958b34d3f70dbc7e51aec49af4 to your computer and use it in GitHub Desktop.
A simple shell script to read the password hint for a specific user from the Vaultwarden DB using the command line
#!/bin/bash
set -e
VAULTWARDEN_DB_PATH="/opt/vaultwarden_data/db.sqlite3"
if [[ -z "$1" ]]; then
echo "Usage: get_vaultwarden_pw_hint.sh <USER_EMAIL>" 1>&2
fi
OUTPUT=$(sqlite3 "$VAULTWARDEN_DB_PATH" "SELECT password_hint FROM users WHERE email='$1'")
if [[ -z "$OUTPUT" ]]; then
echo "User with email $1 not found." 1>&2
else
echo "$OUTPUT"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment