Murdoch
Murdoch

Reputation: 630

How to start and stop redis service with authentication?

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.

Upvotes: 10

Views: 12441

Answers (2)

simplytunde
simplytunde

Reputation: 197

redis-cli connect to your server and authenticate yourself.

  1. $ redis-cli -a serverpassword
  2. $ shutdown
  3. $ quit

Upvotes: 4

Darin Dimitrov
Darin Dimitrov

Reputation: 1039160

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"

Upvotes: 15

Related Questions