10

I've set a password for my Redis server and when I try to restart the Redis server with sudo service redis_6379 restart then I get the following error message:

NOAUTH Authentication required.

How can I pass my password through the restart command?

The Redis version is 3.0.3.

Murdoch
  • 630
  • 2
  • 8
  • 21

2 Answers2

15

You could modify your init.d/redis_6379 script and use the -a parameter of redis-cli to specify the password:

CLIEXEC="/usr/local/bin/redis-cli -a your_secret"
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • 1
    More precisely the solution was this: http://stackoverflow.com/a/28658706/241739 You only need a password for stopping the server, not for starting. – Murdoch Aug 23 '15 at 11:00
4

redis-cli connect to your server and authenticate yourself.

  1. $ redis-cli -a serverpassword
  2. $ shutdown
  3. $ quit
simplytunde
  • 197
  • 2
  • 7