Now, authenticate with your password using the below command. You will get an error as you didn’t authenticate. You will be directed to Redis prompt and before authentication, you need to set a key to a value.
Now, restart the Redis service using the below command.Īccess the Redis command line to check if the password works or not. Uncomment it by removing ‘#’ and replace foobared with a highly secured password. Scroll down to the SECURITY section and find look for the below line. To do so, open Redis configuration file, /etc/redis/nf. Configure Redis password enables this auth command. Redis has a security feature called auth command, which allows users to verify their authentication to access the database. But, you haven’t set Redis to require users to verify their authentication before making changes to its configuration or data. So, It will be almost impossible for hackers to gain access to your server. If you get the above output, it means your Redis server is listening only to the localhost and the changes are applied to the Redis configuration file correctly. If you don’t get the above output, you need to check if you have uncommented the correct line within the Redis configuration file. Run the below command to check if the changes are applied or not. Restart the Redis service to apply the changes. Within the file, find the below line and uncomment it (if it’s not. To do so, open the Redis configuration file using the below command. Now, you need to make sure that Redis service is accessible only from localhost and blocking all connections from other sources. You will be directed to Redis prompt and redeem the value using the command: Now, again check the Redis service using the command-line client. Use the below command to restart the Redis service. Now, check if Redis can hold data even after restarting it. You will redeem the following output if everything is working correctly.Īfter ensuring that you are redeeming the value, exit the Redis prompt to go back to the shell. Now, check if you can set keys using the below command.
It means your server connection is still active. Now, check the connectivity using the ping command. You will be directed to the Redis prompt. You can check the Redis service using the command-line client. In this guide, we have given a few methods to test the redis changes.įirst, check the status of the Redis service with the below command. Now, restart the Redis services to apply the changes that you have made.Īfter installing Redis, it’s time to test the Redis service if it is working well or not. # They do not enable continuous liveness pings back to your supervisor. # Note: these supervision methods only signal “process is ready.” # UPSTART_JOB or NOTIFY_SOCKET environment variables # supervised auto – detect upstart or systemd method based on # supervised systemd – signal systemd by writing READY=1 to $NOTIFY_SOCKET # supervised upstart – signal upstart by putting Redis into SIGSTOP mode # supervised no – no supervision interaction # If you run Redis from upstart or systemd, Redis can interact with your By default, the directive is set to ‘no’ and you need to set it to systemd. The supervised directive allows you to allocate an init system to manage Redis services so that you can have more control over its operations. Within the file, find the supervised directive. Open the Redis configuration file using the below command. You need to make a few changes in the configuration file.
To install the latest version of Redis from Ubuntu repositories and update it, use apt command.Īlong with the Redis installation, a Redis configuration would be downloaded. You should have access to an Ubuntu 18.04 server.Ĭreate a non-root user with sudo privileges by following our guide, (. It is used as a database, cache and message broker. It is an in-memory data structure project known for its performance, flexibility, and broad language support. ( is an acronym for Remote Dictionary Service.
In this guide, we will explain to you how to install, configure and secure Redis on Ubuntu 18.04.