hiddenid01 / redis

Automatically exported from code.google.com/p/redis
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Have CLI commands read password from environment #481

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What version of Redis you are using, in what kind of Operating System?
2.1.12

What is the problem you are experiencing?
CLI commands such as "redis-cli" read the password as an argument "redis-cli -a 
<password>" and thus the password shows up in the process table. To fix this, 
Redis could read the password from an environment variable such as 
REDIS_PASSWORD instead (as do PostgreSQL, MySQL etc).

Original issue reported on code.google.com by sven.sch...@gmail.com on 8 Mar 2011 at 3:16

GoogleCodeExporter commented 9 years ago
If you do not want to provide a password on the command line for
security reasons, you just have to launch redis-cli with no -a
option, and then use the AUTH command to provide the password.
It is even more secure than having to define an environment
variable ...

Original comment by didier...@gmail.com on 8 Mar 2011 at 4:04

GoogleCodeExporter commented 9 years ago
I've considered this, but don't see how this could solve my problem: I'd like 
my backup-preexec script to issue a "redis-cli save" (on a password protected 
Redis) before the nightly backup run.

Original comment by sven.sch...@gmail.com on 8 Mar 2011 at 4:23

GoogleCodeExporter commented 9 years ago
You could do something like this:
redis-cli <<EOF
auth $YOUR_PASSWORD
save
EOF

That said, I think using save to backup a production
Redis instance is a mistake, because Redis will be
frozen during the save operation. You would be better
served by a combination of bgsave and lastsave IMO.

Regards,
Didier.

Original comment by didier...@gmail.com on 8 Mar 2011 at 4:40

GoogleCodeExporter commented 9 years ago
Thanks for the hint, that'll work - and make this bug obsolete.

bgsave would be great if the OK were delayed until the fork finished dumping. 
Monitoring lastsave is both cumbersome and troublesome (if the bgsave failed 
for some reason).

Original comment by sven.sch...@gmail.com on 8 Mar 2011 at 5:08

GoogleCodeExporter commented 9 years ago
Thanks a lot ,i have got the solution to my need from your answer.

Original comment by jkryanc...@gmail.com on 31 Aug 2014 at 8:01