Created
January 10, 2025 21:26
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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