Sample Header Ad - 728x90

Reusing password to unlock KeePassXC database and ask user for new password when adding new KeePassXC entry password

1 vote
0 answers
326 views
I do have an issue passing on password to keepassxc-cli in bash. I would like it to unlock and ask for adding a password on KeePassXC entry. When I ask user for a password e.g. read for KeePassXC DB password and I use it to unlock it multiple times: **This works:** echo $passwordForKeepassDatabase | keepassxc-cli add "$keepassxcDatabase" "$databaseGroup/$databaseEntry $currentYear" However, when I need to unlock the KeePassXC DB and simultaneously ask the user for the entry password it does not work. The KeePassXC DB password is used in both cases. **The following does not work correctly** (as it uses the DB password for both prompt - notice the added -p switch): echo $passwordForKeepassDatabase | keepassxc-cli -p add "$keepassxcDatabase" "$databaseGroup/$databaseEntry $currentYear" Any idea for a workaround? I would like to re-use the already entered KeePassXC DB password and then ask the user to enter a password for the new KeePassXC entry.
Asked by tukan (6575 rep)
Mar 8, 2023, 10:49 AM
Last activity: Mar 9, 2023, 08:13 AM