Redis-cli with password
Asked Answered
T

5

103

I am using redis and trying to open CLI of redis using this:

$redis-cli -h 127.0.0.1 -p 6379 -a mysupersecretpassword

and getting and error :

(error) NOAUTH Authentication required

why so ?

Totaquine answered 2/3, 2016 at 11:8 Comment(3)
Are you using the correct password? What is your Redis and redis-cli versions? And I am I correct in assuming that the error is provided only after you actually try to type a command at the cli's prompt?Lanthorn
if I use $redis-cli -h 127.0.0.1 -p 6379 then if authenticate its working. And my redis version is 3.0.3Totaquine
Is it possible that your super secret password is parsed by the shell, i.e. contains magic characters?Lanthorn
S
25

If you have a '$' in your password then it won't work. So set the password without the "$".

Swordplay answered 9/3, 2016 at 11:20 Comment(1)
Just put the password in quote... don't need to remove the $Broadloom
C
106

My solution is put the password in single quotes like:

$redis-cli -h 127.0.0.1 -p 6379 -a 'thisizmy!PASS' 
Circumambulate answered 30/10, 2018 at 2:52 Comment(0)
S
25

If you have a '$' in your password then it won't work. So set the password without the "$".

Swordplay answered 9/3, 2016 at 11:20 Comment(1)
Just put the password in quote... don't need to remove the $Broadloom
T
18

If you have '$' in your password, make sure to enclose the password with single quotes. Then it will work.

Tiphanie answered 13/12, 2017 at 2:10 Comment(0)
F
9

Maybe this would usefull to someone. If you have already open the redis-cli console window, you can type the authentication like this:

auth 'your-password'

and then the console would response with OK

Falkirk answered 8/3, 2023 at 12:37 Comment(0)
P
5

If you're using Redis Access Control List - ACL (Redis 6 and above), you log in with --user and --pass:

redis-cli -h 127.0.0.1 -p 6379 --user redis_user --pass 'redis_password'

or if you are already in redis-cli console you can authenticate with:

auth redis_user 'redis_password'

Panatella answered 31/8, 2023 at 13:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.