Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable redis-cli history

Tags:

redis

I've searched around the web, but have been unable to find a way to disable redis-cli from generating the file ~/.rediscli_history. My concern is that the file logs AUTH information into the file (more info. here: https://github.com/antirez/redis/pull/2413). Any ideas on how to do this?

like image 723
Paul Calabro Avatar asked Oct 25 '25 11:10

Paul Calabro


2 Answers

Just set the environment variable REDISCLI_HISTFILE

env REDISCLI_HISTFILE=/dev/null redis-cli
like image 72
nnog Avatar answered Oct 28 '25 03:10

nnog


How about some creative soft linking instead?

foo@bar:~$ rm .rediscli_history 
foo@bar:~$ ln -s /dev/null .rediscli_history
foo@bar:~$ redis-cli 
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> exit
foo@bar:~$ ls -al .rediscli_history 
lrwxrwxrwx 1 foo foo 9 Sep 30 00:19 .rediscli_history -> /dev/null

BTW - the PR you submitted is effective but I'm not sure I like it - perhaps log the AUTH and mask the password?

like image 39
Itamar Haber Avatar answered Oct 28 '25 03:10

Itamar Haber



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!