I'd like to disable protected-mode
on my production Redis. Regarding to the following error I got from my other Redis-Sentinel instance I could disable it live by connecting to Redis from the master machine it runs on.
DENIED Redis is running in protected mode because protected mode is
enabled, no bind address was specified, no authentication password is
requested to clients. In this mode connections are only accepted from
the loopback interface. If you want to connect from external
computers to Redis you may adopt one of the following solutions:1) Just disable protected mode sending the command 'CONFIG SET
protected-mode no' from the loopback interface by connecting to
Redis from the same host the server is running, however MAKE SURE
Redis is not publicly accessible from internet if you do so. Use
CONFIG REWRITE to make this change permanent.2) Alternatively you can just disable the protected mode by editing
the Redis configuration file, and setting the protected mode
option to 'no', and then restarting the server.3) If you started the server manually just for testing, restart it
with the '–protected-mode no' option.4) Setup a bind address or an authentication password.
NOTE: You only need to do one of the above things in order for
the server to start accepting connections from the outside.
But as I connect and try to disable it I get the Error (error) ERR Unsupported CONFIG parameter: protected-mode
.
There's no auth configured or anything else – all security is managed by firewall rules. The redis.conf
is almost default.
Demo
root@svim-redis03 /etc/redis # redis-cli
127.0.0.1:6379> CONFIG GET protected*
(empty list or set)
127.0.0.1:6379> CONFIG GET bind*
1) "bind"
2) "127.0.0.1"
127.0.0.1:6379> CONFIG SET protected-mode no
(error) ERR Unsupported CONFIG parameter: protected-mode
127.0.0.1:6379> exit
root@svim-redis03 /etc/redis # redis-server --version
Redis server v=3.2.9 sha=00000000:0 malloc=jemalloc-4.0.3 bits=64 build=86450d2ba8219c1e
Is there anything I need to check or change before? I couldn't find any hint in the documentation or in GitHub issues.
Update 01
It's not even possible to change the bind-address or any other config parameter. Do I need to enable config changes first?
127.0.0.1:6379> config set bind "127.0.0.1 11.12.13.14"
(error) ERR Unsupported CONFIG parameter: bind
Best Answer
Turns out that the current server running isn't the same version as the binary I've installed.
How to reproduce this?
Simply connect via
redis-cli
to your redis instance and typeINFO server
which returns a bunch of informations.As you can see this redis-instance runs almost 127 days and uses
redis_version:3.0.7
.How to fix this?
Restart your server and be sure that you realy restarted it! For example with most Linux distros you can do so by hitting the following commands.
Check if it's really offline by trying to connect with
redis-cli
. If you still can connect the instance is still running. Check this by searching for active redis processes.As you can see there's still the instance (process id: 26720) running. Quit it with the following command.
After you've killed the process check again with
ps -efl |grep redis
if the instance is really down.Finally start it again with
Now check if the instance is running with the correct version.