Requirepass is not working

I have setup the requirepass under redis.conf file but unable to get password prompt when going to access redis-cli

cat /etc/redis.conf |grep -v ‘#’ >> redis_configuration

bind 192.168.4.172

protected-mode yes

port 8999

tcp-backlog 511

timeout 0

tcp-keepalive 300

daemonize no

supervised systemd

pidfile “/var/run/redis_6379.pid”

loglevel notice

logfile “/var/log/redis/redis.log”

databases 16

always-show-logo yes

save 900 1
save 300 10
save 60 10000

stop-writes-on-bgsave-error yes

rdbcompression yes

rdbchecksum yes

dbfilename “dump.rdb”

rdb-del-sync-files no

dir “/var/lib/redis”

replica-serve-stale-data yes

replica-read-only yes

repl-diskless-sync no

repl-diskless-sync-delay 5

repl-diskless-load disabled

repl-disable-tcp-nodelay no

replica-priority 100

acllog-max-len 128

requirepass “tpstps”

lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no

lazyfree-lazy-user-del no

appendonly no

appendfilename “appendonly.aof”

appendfsync everysec

no-appendfsync-on-rewrite no

auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb

aof-load-truncated yes

aof-use-rdb-preamble yes

lua-time-limit 5000

slowlog-log-slower-than 10000

slowlog-max-len 128

latency-monitor-threshold 0

notify-keyspace-events “”
hash-max-ziplist-entries 512
hash-max-ziplist-value 64

list-max-ziplist-size -2

list-compress-depth 0

set-max-intset-entries 512

zset-max-ziplist-entries 128
zset-max-ziplist-value 64

hll-sparse-max-bytes 3000

stream-node-max-bytes 4kb
stream-node-max-entries 100

activerehashing yes

client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60

hz 10

dynamic-hz yes

aof-rewrite-incremental-fsync yes

rdb-save-incremental-fsync yes

jemalloc-bg-thread yes

user default on nopass ~* +@all

replicaof 192.168.4.176 8999

How are you connecting? You should be able to connect with redis-cli with or without a password but the only command you’ll be able to use if you don’t provide a password is the AUTH command.

redis-cli -h HOSTNAME -p PORT

This is the command I use and I am able to connect. My query is, why redis is not asking for password prompt OR why i am not denied. See below is for reference

[root@PostgreSQL-Node03 ~]# redis-cli -h 192.168.4.172 -p 8999
192.168.4.172:8999> info replication

Replication

role:slave
master_host:192.168.4.176
master_port:8999
master_link_status:up
master_last_io_seconds_ago:1
master_sync_in_progress:0
slave_repl_offset:47864475
slave_priority:100
slave_read_only:1
connected_slaves:0
master_replid:47833bfc2880cfc971ad21697a015de0c34512ff
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:47864475
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:46815900
repl_backlog_histlen:1048576
192.168.4.172:8999>

I got a different way to do this. Instead of directly editing the redis.conf file I went to redis-cli and then configure the setting like replicaof or bind or etc. After that I ran the command CONFIG REWRITE to make it permanent. This solves my problem means it make the configuration permanent