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 ?
Redis AUTH command is used to authenticate to the server with the given password. If the password matches the password in the configuration file, the server replies with the OK status code and starts accepting commands. Otherwise, an error is returned and the clients needs to try a new password.
When the authorization layer is enabled, Redis will refuse any query by unauthenticated clients. A client can authenticate itself by sending the AUTH command followed by the password. The password is set by the system administrator in clear text inside the redis. conf file.
To start Redis client, open the terminal and type the command redis-cli. This will connect to your local server and now you can run any command.
If you are looking for a simple but temporary solution to set a password for your Redis server, you can use the config set command.
My solution is put the password in single quotes like:
$redis-cli -h 127.0.0.1 -p 6379 -a 'thisizmy!PASS'
If you have a '$' in your password then it won't work. So set the password without the "$".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With