I wanted to cover some security aspect of Redis, using Redis Password feature. Redis uses config file to provide a password for it. The config file is usually located at /etc/redis/redis.conf if you are using linux. Look for the SECURITY section.

If you are using docker you can set the option when you start the docker container.

Afterwards if you are trying to connect to redis using redis-cli you will not be able to launch any commands in it,

In order to set the value x, one will need to authenticate

If you are using StackExchange.Redis you can use the sample code below to connect, as you can see I am just adding the password to the connection string.

For other Redis topics

  1. Intro to Redis for .NET Developers
  2. Redis for .NET Developer – Connecting with C#
  3. Redis for .NET Developer – String Datatype
  4. Redis for .NET Developer – String Datatype part 2
  5. Redis for .NET Developer – Hash Datatype
  6. Redis for .NET Developer – Redis running in Docker
  7. Redis for .NET Developer – Redis running in Azure
  8. Redis for .NET Developer – Redis running in AWS ElastiCache