I got error NOAUTH Authentication required when I connect to Redis server via command: redis-cli
and run ping
to check if Redis is
I Have the same problem, I found it's caused by someone started redis by another redis.cnf
configure file, So I stoped redis-server and then started redis-server specify a configure file.
redis-server /etc/redis.cnf
Then every thing works fine.
If you have made any changes in configuration file then don't forget to restart redis service with sudo service redis-server restart
command.
Edit:
If you are running redis service in production mode then redis requires password to run. For that you need to set password in your config file present at /etc/redis
.
You need to set requirepass *******
in that file under ########### SECURITY ############
section.
Then restart your server sudo service redis-server restart
.
After that add that password in your config or initializer file where you have set your hostname and port. Example:
$redis = Redis.new(:host => 'localhost', :port => 6379, :password => "*******")
I had the same issue (running on AWS) and discovered our redis port was exposed. You probably had the same. Someone was messing around.
EDIT: The solution: reset your redis password and then (assuming you have it running as a service) restart the service providing the new password
Had the exact same problem running Redis on an AWS instance. I would restart redis-server without any password requirements (#requirepass ''), would work fine for a few hours, then would throw "NOAUTH Authentication required" and eventually would have to restart redis-server.
Checked the Security Groups settings in AWS for the instance and saw port 6379 open to the public (0.0.0.0/0). We limited the port access to our only server that needs to access and haven't seen the issue come up ever since!
P.S. This is my first ever contribution to StackOverflow. Thanks for the help!
I Have the same problem. after that I'm set requirepass
for the redis
server.
And add that password in initializer/redis.rb
$redis = Redis.new(:password=>"****")
It works fine
We also faced a similar issue. Looks like someone scanned AWS, connected to all public redis servers, and possibly ran "CONFIG SET REQUIREPASS ''", thus locking down the running instance of redis. Once you restart redis, the config is restored to normal.
Best thing would be to use AWS security group policy and block port 6379 for public.