For Debian-based systems, run the following commands:
user@localhost: ~ sudo apt update
Optional:
user@localhost: ~ sudo apt upgrade
user@localhost: ~ sudo apt install redis-server
For RedHat-based systems, you can connect a remi repository, and run the following commands:
user@localhost: ~ sudo yum install epel-release yum-utils
user@localhost: ~ sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
user@localhost: ~ sudo yum-config-manager --enable remi
user@localhost: ~ sudo yum install redis
user@localhost: ~ sudo systemctl start redis
user@localhost: ~ sudo systemctl enable redis
Check
netstat -plant | grep -i redis
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 1035/redis-server 1
If all goes well, Redis is listening on port 6379.
Security setting
Run redis-server only on localhost
In some Linux distributions, redis accepts requests on all interfaces after installation, which is not allowed for security reasons because redis access is not password protected by default.
Therefore, check the file /etc/redis/redis.conf contains the following line
bind 127.0.0.1
If it is not, enter it there.
Next, if prescribed, then restart Redis:
user@localhost: ~ sudo systemctl restart redis-server
– Put a password to access redis-server:
by default, anyone can connect to redis without a password, for example:
redis-cli info | grep redis_versio
Therefore, create a password of 32 characters:
user@localhost: ~ openssl rand -base64 32
get in the console something type Iouwokmsduhxvqj9fvz1tex9+VX0B1OG9r7sjAeuJY=
And in /etc/redis/redis.conf write on:
requirepass Iouwokmsduhxvqj9fvz1tex9+VX0B1OG9r7sjAeuJY=
Next, if prescribed, then restart Redis:
user@localhost: ~ sudo systemctl restart redis-server
Now when you try to do:
user@localhost: ~ redis-cli info | grep redis_version
if everything is configured correctly, anonymous access is denied and we will not see any information
Connect need now so
redis-cli
127.0.0.1:6379> info
NOAUTH Authentication required.
127.0.0.1:6379> AUTH IoUwOKmsDuHXvqj9FVVz1TEx9+VX0B1OG9r7sjAeuJY=
OK
127.0.0.1:6379> info
# Server
redis_version:2.8.17
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:4c1d5710660b9479
redis_mode:standalone
os:Linux 3.16.0-4-amd64 x86_64
....
127.0.0.1:6379> quit
ATTENTION! By running redis-cli and entering commands in it, including AUTH with a password, the history of these commands is saved in the ~/file.rediscli_history. If an attacker gains access to it, they will be able to learn the password.
Certainly./~ rediscli_history is only available to the current user, such as root, and no one else will read it, but it’s better to know. The password is also stored in the /etc/redis/redis file.conf and by default this file is read by all users of the server, which is completely wrong and we will fix it further.
– Rename and disable important commands
Here’s a dangerous command Redis FLUSHDB, FLUSHALL, KEYS, PEXPIRE, DEL, CONFIG, SHUTDOWN, BGREWRITEAOF, BGSAVE, SAVE, SPOP, SREM, RENAME and DEBUG
To do this, use the /etc/redis/redis file.conf write on:
- rename-command FLUSHDB “”
- rename-command FLUSHALL “”
- rename-command DEBUG “”
- rename-command SHUTDOWN SHUTDOWN_SECRETCMD
- rename-command CONFIG CONFIG_SECRETCMD
Next, if prescribed, then restart Redis:
user@localhost: ~ sudo systemctl restart redis-server
– Change the rights to the directory with the database and configuration file
Look at the default rights to the directory with the database:
ls -ld /var/lib/redis
drwxr-xr-x 2 redis redis 4096 Sep 9 10:14 redis
Change
chmod 700 /var/lib/redis
Look right in the default configuration file
ls -l /etc/redis/redis.conf
-rw-r--r-- 1 root root 33004 Sep 9 10:15 /etc/redis/redis.conf
Change
chown redis:root /etc/redis/redis.conf
chmod 600 /etc/redis/redis.conf
Next, if all done, then restart Redis:
user@localhost: ~ sudo systemctl restart redis-server
This completes the basic redis setup
IverCare Pharmacy: IverCare Pharmacy – stromectol metabolize
Link vao GK88 m?i nh?t Khuy?n mai GK88 Link vao GK88 m?i nh?t
Beta138: Situs judi resmi berlisensi – Situs judi resmi berlisensi
Casino online GK88: Link vao GK88 m?i nh?t – Dang ky GK88
Jollibet online sabong: jollibet – jollibet app
https://mandiwinindo.site/# Situs judi online terpercaya Indonesia
Jiliko bonus: Jiliko – Jiliko bonus
Casino online GK88: Nha cai uy tin Vi?t Nam – Rut ti?n nhanh GK88
Ca cu?c tr?c tuy?n GK88: Ca cu?c tr?c tuy?n GK88 – Dang ky GK88
Judi online deposit pulsa Slot jackpot terbesar Indonesia Live casino Mandiribet
Withdraw cepat Beta138: Withdraw cepat Beta138 – Login Beta138
Judi online deposit pulsa: Live casino Mandiribet – Bonus new member 100% Mandiribet
Rut ti?n nhanh GK88: Dang ky GK88 – Rut ti?n nhanh GK88
Slot gacor Beta138 Slot gacor Beta138 Link alternatif Beta138
https://jilwin.pro/# Jiliko slots
jollibet app: jollibet app – Online casino Jollibet Philippines
Login Beta138: Promo slot gacor hari ini – Withdraw cepat Beta138
Swerte99 casino walang deposit bonus para sa Pinoy: Swerte99 bonus – Swerte99 slots
Swerte99 casino Swerte99 Swerte99 slots
Onlayn kazino Az?rbaycan: Pinco kazino – Pinco il? real pul qazan
Abutogel: Jackpot togel hari ini – Situs togel online terpercaya
Qeydiyyat bonusu Pinco casino: Qeydiyyat bonusu Pinco casino – Onlayn kazino Az?rbaycan
Swerte99 login: Swerte99 casino walang deposit bonus para sa Pinoy – Swerte99 app
jollibet app 1winphili Online gambling platform Jollibet
Withdraw cepat Beta138: Bandar bola resmi – Login Beta138
https://pinwinaz.pro/# Kazino bonuslar? 2025 Az?rbaycan
Pinco kazino: Uduslar? tez c?xar Pinco il? – Kazino bonuslar? 2025 Az?rbaycan
Link vào GK88 m?i nh?t: Nhà cái uy tín Vi?t Nam – Nhà cái uy tín Vi?t Nam
Swerte99 bonus: Swerte99 bonus – Swerte99 online gaming Pilipinas
jollibet jollibet login jollibet casino
Swerte99 online gaming Pilipinas: Swerte99 casino – Swerte99 slots
Situs togel online terpercaya: Abutogel – Link alternatif Abutogel
Abutogel login: Jackpot togel hari ini – Bandar togel resmi Indonesia
Jiliko casino walang deposit bonus para sa Pinoy Jiliko slots Jiliko
Situs judi online terpercaya Indonesia: Situs judi online terpercaya Indonesia – Slot jackpot terbesar Indonesia
https://abutowin.icu/# Link alternatif Abutogel
Onlayn rulet v? blackjack: Yeni az?rbaycan kazino sayti – Uduslari tez çixar Pinco il?
Pinco casino mobil t?tbiq: Yeni az?rbaycan kazino sayt? – Yuks?k RTP slotlar
Judi online deposit pulsa: Slot gacor hari ini – Live casino Mandiribet
Etibarl? onlayn kazino Az?rbaycanda Onlayn kazino Az?rbaycan Uduslar? tez c?xar Pinco il?