Bird
Raised Fist0
Redisquery~20 mins

Protected mode in Redis - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Redis Protected Mode Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the purpose of Redis protected mode?
Redis protected mode is enabled by default. What is its main purpose?
ATo limit the number of client connections to Redis
BTo encrypt all data stored in Redis automatically
CTo prevent Redis from accepting connections from external IP addresses by default
DTo automatically backup Redis data every hour
Attempts:
2 left
💡 Hint
Think about security when Redis is started without a password and accessible from outside.
❓ query_result
intermediate
2:00remaining
What happens when you try to connect remotely to Redis in protected mode without authentication?
Assuming Redis is running with protected mode enabled and no password set, what will be the result of a remote connection attempt?
AConnection succeeds and allows all commands
BConnection succeeds but only read commands are allowed
CConnection is accepted but immediately disconnected
DConnection is refused with an error message about protected mode
Attempts:
2 left
💡 Hint
Protected mode blocks unauthorized remote connections.
📝 Syntax
advanced
2:00remaining
Which configuration disables Redis protected mode correctly?
You want to disable Redis protected mode by editing redis.conf. Which line is correct?
Aprotected-mode no
Bprotected_mode off
Cdisable-protected-mode yes
Dprotectedmode false
Attempts:
2 left
💡 Hint
Check the exact spelling and syntax of the configuration directive.
❓ optimization
advanced
2:00remaining
How to safely allow remote connections while keeping Redis secure?
You want to allow remote clients to connect to Redis but keep it secure. Which approach is best?
ADisable protected mode and rely on firewall only
BDisable protected mode and set a strong password with 'requirepass' directive
CKeep protected mode enabled and connect remotely without authentication
DDisable protected mode and open Redis port to the internet without password
Attempts:
2 left
💡 Hint
Think about authentication and network access controls.
🔧 Debug
expert
3:00remaining
Why does Redis refuse remote connections despite disabling protected mode?
You disabled protected mode in redis.conf but remote clients still cannot connect. What could be the cause?
ARedis is bound only to localhost (127.0.0.1) in the 'bind' configuration
BRedis requires a password but none was set
CRedis server is not running
DProtected mode is still enabled by default
Attempts:
2 left
💡 Hint
Check the network interface Redis listens on.

Practice

(1/5)
1. What is the main purpose of Redis protected-mode?
easy
A. To increase Redis performance by caching data
B. To limit connections and keep Redis safe by default
C. To enable automatic backups of Redis data
D. To allow unlimited remote connections without restrictions

Solution

  1. Step 1: Understand what protected mode does

    Protected mode is designed to keep Redis safe by limiting who can connect to it.
  2. Step 2: Identify the main purpose

    It prevents unauthorized access by restricting connections unless properly configured.
  3. Final Answer:

    To limit connections and keep Redis safe by default -> Option B
  4. Quick Check:

    Protected mode = Limits connections [OK]
Hint: Protected mode restricts connections to protect Redis [OK]
Common Mistakes:
  • Thinking it improves performance
  • Confusing it with backup features
  • Assuming it allows open access
2. Which of the following is the correct way to disable protected mode in the Redis configuration file?
easy
A. protected-mode no
B. protected-mode yes
C. protected_mode no
D. disable-protected-mode true

Solution

  1. Step 1: Identify the correct syntax for the setting

    The Redis config uses protected-mode with a dash, not underscore or other variations.
  2. Step 2: Determine the value to disable it

    Setting protected-mode no disables protected mode.
  3. Final Answer:

    protected-mode no -> Option A
  4. Quick Check:

    Disable protected mode = protected-mode no [OK]
Hint: Use dash and 'no' to disable protected mode [OK]
Common Mistakes:
  • Using underscore instead of dash
  • Setting value to 'yes' to disable
  • Using invalid config keys
3. Given the Redis config snippet:
protected-mode yes
bind 127.0.0.1

What will happen if a client tries to connect from a remote IP?
medium
A. Connection will be rejected due to protected mode and bind settings
B. Connection will be accepted without restrictions
C. Redis will crash with an error
D. Connection will be accepted only if password is provided

Solution

  1. Step 1: Analyze protected mode and bind settings

    Protected mode is enabled and Redis is bound only to localhost (127.0.0.1).
  2. Step 2: Understand remote connection behavior

    Clients from remote IPs cannot connect because Redis listens only on localhost and protected mode blocks unsafe access.
  3. Final Answer:

    Connection will be rejected due to protected mode and bind settings -> Option A
  4. Quick Check:

    Protected mode + bind localhost = reject remote [OK]
Hint: Protected mode + bind localhost blocks remote clients [OK]
Common Mistakes:
  • Assuming remote connections are allowed
  • Thinking Redis crashes on remote connect
  • Believing password alone allows connection
4. You set protected-mode no in your Redis config but remote clients still cannot connect. What is the most likely cause?
medium
A. Redis server is not running
B. Redis requires a password to connect remotely
C. The bind setting restricts connections to localhost
D. Protected mode is still enabled by default

Solution

  1. Step 1: Check the effect of disabling protected mode

    Disabling protected mode allows remote connections if no other restrictions exist.
  2. Step 2: Identify other config restrictions

    If bind 127.0.0.1 is set, Redis only listens on localhost, blocking remote clients.
  3. Final Answer:

    The bind setting restricts connections to localhost -> Option C
  4. Quick Check:

    Bind localhost blocks remote even if protected mode off [OK]
Hint: Check bind setting if remote access fails despite disabling protected mode [OK]
Common Mistakes:
  • Assuming protected mode disables instantly without config reload
  • Ignoring bind restrictions
  • Thinking password is mandatory for remote connect
5. You want to allow remote connections to Redis safely. Which configuration is the best practice?
hard
A. Set protected-mode no and bind 0.0.0.0 without password
B. Keep protected-mode yes, bind to localhost, and use SSH tunnel for remote access
C. Disable protected mode and allow connections from any IP without authentication
D. Disable protected mode, bind to all interfaces, and require a strong password

Solution

  1. Step 1: Understand risks of disabling protected mode

    Disabling protected mode requires securing Redis by other means like authentication.
  2. Step 2: Combine settings for safe remote access

    Binding to all interfaces (0.0.0.0) allows remote connections, but a strong password is needed to secure access.
  3. Final Answer:

    Disable protected mode, bind to all interfaces, and require a strong password -> Option D
  4. Quick Check:

    Safe remote access = disable protected mode + bind all + password [OK]
Hint: Disable protected mode only with password and open bind [OK]
Common Mistakes:
  • Disabling protected mode without password
  • Binding only to localhost for remote access
  • Allowing open access without authentication
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard