Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Pass command line credentials and key files to single instance #2089

Open
kareliot opened this issue Jul 3, 2018 · 8 comments
Open

Pass command line credentials and key files to single instance #2089

kareliot opened this issue Jul 3, 2018 · 8 comments
Assignees
Milestone

Comments

@kareliot
Copy link

kareliot commented Jul 3, 2018

It would be very nice to have a way to automatically unlock a database after unlocking the session. Especially for cases where the setting "Close database when session is locked" is turned on.

Expected Behavior

Provide a way to open/unlock a database of an running instance of keepassxc, similar to the method used for autostart on login (which on gnome/linux would be something like:"secret-tool lookup 'keepass' 'passwords' | keepassxc --pw-stdin path/to/database.kdbx")

Current Behavior

If I try to open a database (with the above --pw-stdin command) when an instance of keepassxc is already running, I just get "Another instance of KeePassXC is already running"

Possible Solution

Provide a way of sending a password (for a closed database) to a running instance of keepassxc via the command line

Steps to Reproduce (for bugs)

  1. start keepassxc with closed database (such as you would have after automatically locking the session of the os)
  2. try to open a database from the command line with the --pw-stdin command
  3. You get a message at the terminal telling you that another instance of keepassxc is already running

Operating system: Arch Linux, Gnome

@droidmonkey
Copy link
Member

Good idea

@TheZ3ro
Copy link
Contributor

TheZ3ro commented Jul 3, 2018

Duplicate of #1405

@TheZ3ro TheZ3ro marked this as a duplicate of #1405 Jul 3, 2018
@TheZ3ro TheZ3ro closed this as completed Jul 3, 2018
@kareliot
Copy link
Author

kareliot commented Jul 4, 2018

No, this is definitely not a duplicate of #1405 !
I even posted the solution from #1405 in my first comment and explicitly stated that it does not work here.

The scenario in #1405 is about starting keepassxc with the -pw-stdin argument. That works fine (as stated above). However, this issue is about passing the -pw-stdin argument to an already running instance of keepassxc so that a database can automatically be opened when a dbus event is triggered or when unlocking the session.
One workaround would of course be to automatically close/kill keepassxc when locking the session and then start it again when unlocking, but this is really more of a workaround then a solution I guess.

@droidmonkey droidmonkey reopened this Jul 4, 2018
@TheZ3ro
Copy link
Contributor

TheZ3ro commented Jul 5, 2018

Sorry, missed that in the first comment :)

@tuxcrafter
Copy link

tuxcrafter commented Feb 18, 2021

#6143
KeePassXC-Browser 1.7.6
KeePassXC 2.6.4

  1. Please make it possible to open multiple databases from the command line and keep them open and available. I would suggest adding an additional command line option: --background or --daemon or --load.

The trick is knowing which key goes with which database that is why I suggest being able to add a database/key single command and add talk to a running process and add them in an open state.

keepassxc /path/to/database01.kdbx -k /home/jdoe/keyfile01.key --background --minimized
keepassxc /path/to/database02.kdbx -k /home/jdoe/keyfile02.key --background --minimized
keepassxc /path/to/database03.kdbx -k /home/jdoe/keyfile03.key --background --minimized

  1. Please make the MinimizeOnStartup an command line option, so I can script the start of the application as minimized but when the user loads the application manually it starts normally and not minimized.

I will donate an other 150 euro if the above features get implemented in the KeePassXC 2.6.5 release.

Jelle de Jong

@droidmonkey droidmonkey added this to the v2.7.0 milestone Feb 19, 2021
@droidmonkey droidmonkey self-assigned this Feb 19, 2021
@michaelk83
Copy link

michaelk83 commented Apr 17, 2021

Some KDE apps have command line arguments to run in single-instance mode. For example, kate has a -u|--use switch to reuse a running instance when opening a file. The same can be added to KPXC when opening DBs from CLI. Then -u --pw-stdin would open in the running instance, using the supplied password.

But that said, if trying to open a 2nd instance just gives an error, then an extra switch isn't useful. It should just be the default behavior instead of the error.

@droidmonkey droidmonkey modified the milestones: v2.7.0, v2.7.1 Mar 21, 2022
@phoerious phoerious modified the milestones: v2.7.1, v2.7.2 Apr 12, 2022
@droidmonkey droidmonkey modified the milestones: v2.7.2, v2.8.0 Sep 7, 2022
@bjornfor
Copy link

What if keepassxc itself would send dbus messages a.la. https://github.com/keepassxreboot/keepassxc/wiki/Using-DBus-with-KeePassXC to unlock the database in the running instance? It doesn't sound complicated, but then I don't know a thing about the code base :-)

(Btw, the dbus examples in the linked wiki page leak the password in process listings. Eek!)

@droidmonkey
Copy link
Member

Dbus only exists on linux.

@droidmonkey droidmonkey changed the title Pass command line credentials to single instance Pass command line credentials and key files to single instance Oct 14, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

7 participants