How to fix NOAUTH Authentication required in Redis

RedisINTERMEDIATEHIGHUpdated Dec 29, 2025· 344 views

Redis requires authentication when a password is set with the requirepass configuration. Fix this error by either authenticating with your password before running commands or configuring your Redis client to include credentials.

Quick fix

Fixes NOAUTH Authentication required

redis-cli
127.0.0.1:6379> CONFIG GET requirepass
  1. Verify Redis has requirepass enabled
  2. Authenticate with redis-cli using AUTH command
  3. Use redis-cli with -a flag for one-off commands
  4. Configure your application to send AUTH command
redis — error
redis-cli
127.0.0.1:6379> CONFIG GET requirepass
NOAUTH Authentication required

What this error means

This error occurs when Redis has password protection enabled (via the requirepass configuration directive) and a client attempts to execute commands without first authenticating. Redis acts as a security gatekeeper—any client must send an AUTH command with the correct password before executing any other command. This is a fundamental security feature to prevent unauthorized access to your data. When Redis returns "NOAUTH Authentication required," it means your client successfully connected to the Redis server, but the server rejected the command because authentication hasn't been completed yet. This commonly happens in development when switching from unsecured to password-protected Redis, or in production when credentials are misconfigured in your application.

Typical symptoms

  • Commands fail immediately with 'NOAUTH Authentication required' error
  • redis-cli commands work without password, but application connections fail
  • Connection to Redis server succeeds, but all operations are rejected
  • Cloud Redis instances (AWS ElastiCache, Azure Cache, Upstash) fail to connect
  • Error appears in application logs without any permission-related system errors

Common causes

  1. Redis server has requirepass enabled but client is not sending AUTH command
  2. Incorrect password provided in client connection configuration
  3. Client library not configured to use authentication credentials
  4. Password was recently set on previously open Redis instance
  5. Malicious actor set a requirepass on a publicly exposed Redis instance
  6. Managed Redis service (cloud) has authentication enabled but not configured in application

How to fix "NOAUTH Authentication required"

1Verify Redis has requirepass enabled

First, check if your Redis instance actually has password protection enabled. Connect with redis-cli and check the requirepass config:

bash
redis-cli
127.0.0.1:6379> CONFIG GET requirepass

If the second value is empty string or "", authentication is not enabled. If it shows a password string, authentication is active and you must authenticate before other commands.

2Authenticate with redis-cli using AUTH command

If password protection is enabled, authenticate interactively:

bash
redis-cli
127.0.0.1:6379> AUTH yourpassword
OK
127.0.0.1:6379> PING
PONG

Replace "yourpassword" with your actual Redis password. Once AUTH succeeds, you can run any command.

3Use redis-cli with -a flag for one-off commands

For quick CLI operations without interactive prompt, pass password with -a flag:

bash
redis-cli -a yourpassword PING
redis-cli -a yourpassword GET mykey
redis-cli -a yourpassword SET mykey "value"

Note: Using -a flag shows the password in your shell history. For sensitive environments, prefer interactive authentication.

4Configure your application to send AUTH command

Most Redis client libraries automatically authenticate if you include the password in the connection string or configuration:

Node.js (ioredis):

javascript
const redis = require('ioredis');
const client = new redis({
  host: '127.0.0.1',
  port: 6379,
  password: 'yourpassword'  // Will auto-send AUTH
});

Node.js (redis client):

javascript
const { createClient } = require('redis');
const client = createClient({
  socket: {
    host: 'localhost',
    port: 6379,
  },
  password: 'yourpassword'
});
await client.connect();

Python (redis-py):

python
import redis
client = redis.Redis(host='localhost', port=6379, password='yourpassword')
client.ping()

Java (Jedis):

java
Jedis jedis = new Jedis("localhost", 6379);
jedis.auth("yourpassword");
jedis.ping();

Check your client library's documentation for the exact syntax. Most modern clients accept password in the connection URL.

5For Redis URLs, ensure correct format with password

If using a connection URL or URI, include the password before the host:

bash
redis://:[password]@[host]:[port]
redis://:[yourpassword]@localhost:6379

Note the colon after redis:// and the @ separator before the host. Some clients like ioredis require this exact format.

6Reset or disable requirepass if you forgot the password

If you've lost the password and need access, you must:

1. Stop the Redis server:

bash
redis-cli shutdown

2. Edit redis.conf (usually in /etc/redis/ or the config directory):

bash
# Find and comment out this line:
# requirepass youroldpassword

# Or remove the line entirely

3. Restart Redis:

bash
redis-server /path/to/redis.conf

4. Now you can connect without password:

bash
redis-cli
127.0.0.1:6379> PING
PONG

Warning: This temporarily removes authentication. Set a new password immediately and update your application configuration.

Advanced notes

Cloud-Hosted Redis (AWS ElastiCache, Azure Cache, Upstash, etc.):
Cloud Redis instances typically have authentication enabled by default. When you provision a managed Redis instance, the service generates a password or token. Make sure to:
1. Extract the password/token from your cloud dashboard
2. Include it in your connection string (many cloud services provide this)
3. Update any CI/CD secrets or environment variables with the credentials
4. Test the connection before deploying

AWS ElastiCache Special Case:
If you recently provisioned or updated an ElastiCache cluster, AWS may have auto-scanned and modified the requirepass setting. In this case, you may need to reboot the Redis cluster from the AWS console to restore the original configuration.

Security Best Practices:
- Never hardcode passwords in source code; use environment variables
- Rotate passwords regularly in production
- Use strong passwords (16+ characters, mixed case, numbers, symbols)
- For sensitive applications, consider VPC-only Redis instances instead of password-only protection
- Consider using Redis ACLs (ACL USERS, ACL SETUSER) for fine-grained access control in Redis 6+

Frequently asked questions

What does "NOAUTH Authentication required" mean?
This error occurs when Redis has password protection enabled (via the requirepass configuration directive) and a client attempts to execute commands without first authenticating. Redis acts as a security gatekeeper—any client must send an AUTH command with the correct password before executing any other command. This is a fundamental security feature to prevent unauthorized access to your data.
How do I fix "NOAUTH Authentication required"?
Redis requires authentication when a password is set with the requirepass configuration. Fix this error by either authenticating with your password before running commands or configuring your Redis client to include credentials.
What causes "NOAUTH Authentication required"?
Redis server has requirepass enabled but client is not sending AUTH command Incorrect password provided in client connection configuration Client library not configured to use authentication credentials
Is the "NOAUTH Authentication required" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading