1

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.

tukan
  • 4,876
  • 6
  • 19

0 Answers0