0
0
Redisquery~20 mins

Authentication with requirepass in Redis - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis Authentication Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
2:00remaining
What happens when you try to run a command without AUTH after setting requirepass?
Assume Redis is configured with requirepass mysecret. What is the output of running GET key1 without authenticating first?
Redis
GET key1
AError: NOAUTH Authentication required.
Bkey1's value
Cnil
DOK
Attempts:
2 left
💡 Hint
Think about what Redis requires before allowing commands when requirepass is set.
query_result
intermediate
2:00remaining
What is the output of AUTH with wrong password?
If Redis is configured with requirepass mysecret, what is the output of AUTH wrongpass?
Redis
AUTH wrongpass
A+OK
B-ERR invalid password
C-ERR wrong number of arguments for 'auth' command
D-ERR Authentication required.
Attempts:
2 left
💡 Hint
What does Redis reply when the password is incorrect?
📝 Syntax
advanced
2:00remaining
Which AUTH command syntax is correct to authenticate with password 'mypassword'?
Choose the correct Redis AUTH command syntax to authenticate with password 'mypassword'.
AAUTH mypassword
BAUTH password='mypassword'
CAUTH 'mypassword'
DAUTH password mypassword
Attempts:
2 left
💡 Hint
AUTH command takes the password as a single argument without quotes or keywords.
🧠 Conceptual
advanced
2:00remaining
Why is setting requirepass important in Redis?
Select the best reason why setting requirepass in Redis configuration is important.
AIt compresses Redis data to save memory.
BIt encrypts all data stored in Redis automatically.
CIt requires clients to authenticate before running commands, protecting data.
DIt enables Redis to run on multiple CPUs.
Attempts:
2 left
💡 Hint
Think about what security feature requirepass provides.
🔧 Debug
expert
3:00remaining
Why does this Redis client fail to authenticate?
A Redis client runs these commands: 1. SET key1 value1 2. AUTH mysecret 3. GET key1 Redis is configured with requirepass mysecret. The client gets an error on the SET command. Why?
Redis
SET key1 value1
AUTH mysecret
GET key1
ARedis does not support AUTH command.
BThe password 'mysecret' is incorrect.
CGET command must come before AUTH.
DThe client must authenticate before running any commands, so SET fails because it runs before AUTH.
Attempts:
2 left
💡 Hint
Consider the order of commands and when authentication is required.