I use a password manager (to be specific: pass) to store my passwords. The interface I use most often is passmenu to put the password on my clipboard, which I can then paste in my terminal/browser/whatever.

Sometimes I'm not careful and I forgot that I have my password still on my clipboard and I paste it somewhere I shouldn't. What I would like is to have some protection from myself and only be able to paste the password once: after pasting the clipboard should be cleared.

Now it's probably not to hard to hack something together that does this with the standard unix tools. Before I do so, I would like to know if I'm not reinventing something that already exists. Also, it would be good to know if there are any password managers that have this functionality built-in?

Ps. I know that some password managers clear the clipboard after a specified time, but that's not the solution I am looking for.

  • write an autohotkey script that looks for a paste combo, waits one second, then runs a copy keypress – dandavis Nov 2 '16 at 20:26
  • I'd just like to add that this is a thing. I created a password manager and one of the features was that it cleared the clipboard when the shell closed. (github.com/libeclipse/visionary) – Awn Nov 3 '16 at 8:03
  • This sounds like the kind of question Ubuntu Stack Exchange would help with, except that you might not be using Ubuntu. Other then that I think Super User is a better fit than IT Security. Overall you might not be able to get good product recommendations from Stack Exchange because it is against their policy. – 700 Software Nov 3 '16 at 14:35
  • @GeorgeBailey: That seems reasonable. Is there a way I can move the question to Super User? – Sebastian Nov 3 '16 at 19:57

I actually switched from pass to keepassx2, because it clears the clipboard after 5 seconds. Before that I just had a shell script, that I used to call pass that cleared, that clipboard 10 seconds after pass was closed.


I do not know of a password manager which provides this facility built-in. However, this is how I have implemented it in my system.

I use gpaste clipboard manager which can store multiple clipboard entries in a list. gpaste provides a command to delete a specified clipboard entry. Lastly, I have configured a hot-key Ctrl + Super + V to paste and delete the current entry.

Not the answer you're looking for? Browse other questions tagged or ask your own question.