Using CentOS 6.x, for applying Password Authentication in Redis through requirepass Configuration, we need to edit the redis.conf file.
Open the configuration file(name of the file may vary in your machine):
/etc/redis/6379.conf
Find # requirepass foobared and change it in following way:
requirepass yourpasswordSave your changes and restart redis-server
service redis_6379 restart
redis-cli
127.0.0.1:6379>set test "TestEntry"Since we have applied password in Redis Configurtion file "/etc/redis/6379.conf" , we will get NOAUTH error as follows:
(error) NOAUTH Authentication required.while being in redis-cli, write following command with your password for authentication:
127.0.0.1:6379> auth yourpassword OKAnd then when you will set any value, it will return OK
127.0.0.1:6379> set test "TestEntry" OKWe can also run redis-cli directly with password authentication by using following command:
redis-cli -a "yourpassword"We get OK when we run redis-cli in this way and set any value:
127.0.0.1:6379> set test2 "TestEntry2" OK

Very well explained! It’s great to see content that is both informative and beginner-friendly. Combining this with a DevOps Course Training for Beginners can be very beneficial.
ReplyDeleteThe article provides a practical walkthrough for securing a Redis installation on CentOS by enabling password authentication through the requirepass setting. It clearly demonstrates the configuration change, Redis service restart, and the NOAUTH response that occurs when a client attempts to access Redis without authenticating first.
ReplyDeleteInformation Security Projects is a suitable connection because the article focuses directly on protecting access to a database service through authentication. Configuring Redis with a password helps enforce controlled access and prevents unauthenticated commands from being executed through redis-cli.
The authentication workflow also demonstrates an important practical security concept: access controls must be enforced consistently at the service level. After authentication with AUTH, Redis accepts subsequent commands, while the unauthenticated attempt produces a NOAUTH error. This makes the example relevant to Cyber Security Projects for Final Year Students focused on authentication and protecting application infrastructure.
ReplyDelete