Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Excellent tutorial, however from step 4 onwards, there’s a MUCH better way to secure Redis using ACLs (which is the recommended approach, as of Redis 6). I’ll be using vim as my preferred code editor, but the instructions will still work with nano:
sudo vi /etc/redis/redis.conf
Uncomment the external users ACL file:
# Using an external ACL file
#
# Instead of configuring users here in this file, it is possible to use
# a stand-alone file just listing users. The two methods cannot be mixed:
# if you configure users here and at the same time you activate the external
# ACL file, the server will refuse to start.
#
# The format of the external ACL user file is exactly the same as the
# format that is used inside redis.conf to describe users.
#
aclfile /etc/redis/users.acl
Before creating the ACL, I would recommend creating an additional user called sammy with limited rights, while leaving the default user to act as an admin user over redis (having most rights):
openssl rand 60 | openssl base64 -A
Output:
QbXy20zFC0U1DBLvfIxJYroi3U25seRlVnzPJcsOksVRiYKm1ScBwuE6oOXPcxHGCn4Lg1ydlc+xA1pk
openssl rand 60 | openssl base64 -A
Output:
yH8u9lWGgLiqMmywALqs4ZN11SkC4xuTNBjVE4NG9Is4qG1SLJ2CBpqPx3nhM9EEh46fbgT4nl5rNhZH
sudo vi /etc/redis/users.acl
Add the following content to the file:
user default on +@all ~* >QbXy20zFC0U1DBLvfIxJYroi3U25seRlVnzPJcsOksVRiYKm1ScBwuE6oOXPcxHGCn4Lg1ydlc+xA1pk
user sammy on +@all -@dangerous ~* >yH8u9lWGgLiqMmywALqs4ZN11SkC4xuTNBjVE4NG9Is4qG1SLJ2CBpqPx3nhM9EEh46fbgT4nl5rNhZH
In the above example, the default user will have full permissions over redis (denoted by the +@all directive). User sammy will have all permissions excluding the dangerous ones (denoted by the -@dangerous directive). The previously generated passwords are added after the greater than (>) command.
sudo systemctl restart redis
Login to redis:
redis-cli
Authenticate as user sammy:
127.0.0.1:6379> auth sammy yH8u9lWGgLiqMmywALqs4ZN11SkC4xuTNBjVE4NG9Is4qG1SLJ2CBpqPx3nhM9EEh46fbgT4nl5rNhZH
Output:
OK
Once logged in as sammy, try to run some dangerous commands:
127.0.0.1:6379> config help
Output:
(error) NOPERM this user has no permissions to run the 'config' command or its subcommand
127.0.0.1:6379> flushall
Output:
(error) NOPERM this user has no permissions to run the 'flushall' command or its subcommand
127.0.0.1:6379> flushdb
Output:
(error) NOPERM this user has no permissions to run the 'flushdb' command or its subcommand
Hi guys, do you recommend upgrading to 7? Because with this installation install the 6.0.16