Skip to content

Instantly share code, notes, and snippets.

@trongnghia203
Last active June 26, 2020 08:59
Show Gist options
  • Save trongnghia203/3a32e1dc3260c934e4b5a4bfcd50dc05 to your computer and use it in GitHub Desktop.
Save trongnghia203/3a32e1dc3260c934e4b5a4bfcd50dc05 to your computer and use it in GitHub Desktop.
Install and Secure Redis on Ubuntu

Install and Secure Redis on Ubuntu

My reference:

1. Installing and Configuring Redis

sudo apt update
sudo apt install redis-server

2. Testing Redis

service redis-server status
netstat -lntp | grep 6379
redis-cli
127.0.0.1:6379> set test "It's working!"
127.0.0.1:6379> get test
127.0.0.1:6379> exit

redis-check-status-lntn203-trongnghia203-flo

3. Binding to localhost

vi /etc/redis/redis.conf

bind 127.0.0.1

4. Configuring a Redis Password

Run this command to generate a strong password

openssl rand 60 | openssl base64 -A

redis-pass-generate-lntn203-trongnghia203-flo.gif

vi /etc/redis/redis.conf

redis-requirepass-lntn203-trongnghia203-flo.gif

5. Config ufw, iptables, aws sercurity groups....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment