So you're using that snazzy wallet encryption stuff to keep an online wallet locked up when you don't intend to send anything... but problem: You're a CLI user and you're ending up with the walletpassphrase in your shell history.
Don't worry: Bash has you covered (this is also possible in some other shells, but you're on your own there).
Just set HISTIGNORE='*walletpassphrase*' and the shell history will not remember any line with the string walletpassphrase in it.
This list is colon-separated if you want to add more patterns.
Note: walletpassphrase above is
literally the string "walletpassphrase". Do
not substitute your actual passphrase there! (thanks to the comments below for pointing out this potential confusion.
For example, my ~/.bashrc might look like:
$ cat ~/.bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
HISTSIZE=50000
HISTCONTROL=ignoreboth
shopt -s histappend
HISTIGNORE='*walletpassphrase*'
HISTCONTROL=ignoreboth makes the history ignore duplicate commands and commands which are prefixed with spaces, so you can keep other cruft out of your history on the fly, and HISTSIZE=50000 greatly expands the maximum history, histappend makes it append to instead of overwriting the stored history, allowing your history to go back a long way. None of these are required for thie HISTIGNORE but you might find them useful too.
After putting it in your bashrc, restart your shell.
You can instantly tell if its working, e.g.
$ ls foof
ls: cannot access foof: No such file or directory
——now push up——
$ ls foof
ls: cannot access foof: No such file or directory
$ ls walletpassphrase
ls: cannot access walletpassphrase: No such file or directory
——now push up——
$ ls foof
Of course, best security practices would be to not keep wallets that matter online, but with a little care you can increase you security for what you do keep online.
Cheers,