Redis is a secondary database that is useful for session storage as well as performing background jobs like sending emails, user notifications,..etc.
In this blog post you will learn how to install a stable & secured version of redis by the following steps:
1. Install stable version of Redis
To install Redis, first make sure the tcl package is installed.
sudo aptitude install build-essential tcl8.5
1.1 Check for the latest version of Redis and grab it into your /tmp directory.
cd /tmp wget http://download.redis.io/releases/redis-stable.tar.gz
Now extract it.
tar xzf redis-stable.tar.gz
Then configure it and install it.
1.2 Installing the server
In the same directory you extracted the redis stable version, write in your terminal
cd redis-stable make make test sudo make install
Then configure an instance and add it to your boot sequence
cd utils sudo ./install_server.sh
Now test your installation:
sudo service redis_6379 start
Check it through its command line interface:
redis-cli
You now have Redis installed and running. The prompt will look like this:
redis 127.0.0.1:6379>
Type in ping, and the prompt should look like this:
redis 127.0.0.1:6379> ping PONG
To set Redis to automatically start at boot, run:
sudo update-rc.d redis_6379 defaults
2. Secure the installed Redis
2.1 Binding to localhost
By default, Redis server is only accessible from localhost. However, if you followed the tutorial to set up a Redis master server, you updated the configuration file to allow connections from anywhere. This is not as secure as binding to localhost.
Open the Redis configuration file for editing:
sudo vim /etc/redis/6379.conf
Locate this line and make sure it is uncommented (remove the # if it exists):
# bind 127.0.0.1
2.2 Configuring Redis password
Configuring a Redis password enables one of its two built-in security feature – the auth command, which requires clients to authenticate to access the database. The password is configured directly in Redis’s configuration file, /etc/redis/6379.conf
, which you should still have open from the previous step.
Scroll to the SECURITY section and look for a commented directive that reads:
# requirepass foobared
Uncomment it by removing the #, and change foobared to a very strong and very long value. Instead of foobared, make a more complex password using one of sha algorithm types like:
$: echo -n "yournormalstring" | openssl sha1 f44f60738a2ecbc060a7fe974371997137ac4e69
Store this key just in case. Then alter your redis conf file to be:
requirepass f44f60738a2ecbc060a7fe974371997137ac4e69
After setting the password, save the file, and restart Redis:
sudo service redis-server restart
To test that the password works, access the Redis command line and try to write ping, you will get this (error) NOAUTH Authentication required. Do not panic, it is normal as in the next example, until you get the OK acknowledgment:
$: redis-cli redis 127.0.0.1:6379> ping (error) NOAUTH Authentication required. redis 127.0.0.1:6379> auth f44f60738a2ecbc060a7fe974371997137ac4e69 OK
N.B. Do not forget to alter your applications to use the new password accordingly.
Enjoy using a secure redis!
Troubleshoot
In case of any misbehaviour, you can remove the password from the conf file and shutdown redis manually, but you need to make the following:
- Comment the require password line in the redis conf file.
- Go to the redis console
$: redis-cli redis 127.0.0.1:6379> auth f44f60738a2ecbc060a7fe974371997137ac4e69 OK redis 127.0.0.1:6379> shutdown redis 127.0.0.1:6379> quit
- start the redis service, and it is now without a password
sudo service redis_6379 start
Calcular Credito Personal Prestamistas Dinero Simulador De Credito Personal Sacar Prestamo
https://creditosrapidosenusa.space/los-lunas-nm/
Creditos Rapidos A Plazos Creditos Rapidisimos Pedir Dinero
https://creditosrapidosenusa.space/whitney-nv/
Prestamo De Personal Presto Dinero Rapido Particulares El Mejor Credito Personal
https://creditosrapidosenusa.space/rialto-ca/
Prestamos Baratos Quiero Hacer Un Prestamo Personal Ejemplo De Prestamo Personal Creditos Pagina Web
Consulta De Credito Prestamos Con Intereses Como Conseguir Un Prestamo Dinero En Linea Rapido Quien Me Presta Dinero Urgente
https://elprestamista.space/santa-fe-nm/
Prestamos Cortos Y Rapidos Sacar Prestamo Personal Calcular Prestamo Online
https://elprestamista.space/berkeley-ca/
Creditos Personales En El Acto Donde Puedo Sacar Un Credito Facil Y Rapido Tipo De Interes Prestamo Personal
https://elprestamista.space/sacramento-ca/
Prestamos Personales Prestamistas Prestamos De Dinero Con Dni Prestamos Prestamos Personales Como Conseguir Un Prestamo Personal A Cuanto Esta El Interes De Un Prestamo Personal
Prestamos Con Recibo De Sueldo Prestamos Online A Plazos Pago De Prestamo Prestamos De Dinero Rapido En Linea
https://prestamosenestadosunidos.space/clovis-nm/
Comparador Prestamos Personas Prestamistas De Dinero Quiero Hacer Un Prestamo Personal
https://prestamosenestadosunidos.space/santa-maria-ca/
Prestamos En Linea Por Internet Credito Rapido 300 Euros Prestamos Online Con Nomina
https://prestamosenestadosunidos.space/fort-collins-co/
Iaf Prestamos Personales Creditos Rapidos 24 Horas Prestamo De Credito Personal Dinero Privado Prestamos Rapidos Y Faciles Online
Credito 24 Horas Telefono Acceso Credito Facil Y Rapido Prestamos Rapidos Y Seguros
https://creditosrapidosenusa.space/edison-nj/
Todo Sobre El Credito Bancos De Prestamos Rapidos Financiadoras Microcreditos
https://creditosrapidosenusa.space/albuquerque-nm/
Pedir Prestamo Online Rapido Empresa De Prestamos De Dinero Creditos Para Empresas
https://creditosrapidosenusa.space/peachtree-city-ga/
Prestamos A Plazos Rapidos Credito De 300 Mi Primer Prestamo Prestamos De Dinero Rapido En Linea
Comparador Creditos Necesito Dinero Rapido Sacar Prestamo Online Prestar Dinero Online Credito Requisitos
https://prestamosurgente.space/grand-prairie-tx/
Financieras Prestamos De Dinero Mini Prestamos Personales Prestamos Accesibles Agencias De Prestamos De Dinero
https://prestamosurgente.space/vallejo-ca/
Paginas De Prestamos Personales Prestamos Rapidos Y Seguros Financiamiento Dinero Rapido Y Urgente Necesito Prestamo De Dinero Urgente
https://prestamosurgente.space/milton-ga/
Donde Puedo Adquirir Un Prestamo Personal Solicitud De Credito Para Clientes Credito Privado
Prestamos Baratos Mejores Condiciones Prestamo Personal Prestamistas Urgentes Solicitar Prestamo Por Internet Prestamos Personales Solo Con Dni
https://prestamosurgente.space/clearwater-fl/
Prestamos De Dinero En Linea Urgentes Donde Puedo Solicitar Un Prestamo Rapido Dinero Rapido Y Urgente Tasas Creditos Personales
https://prestamosurgente.space/portales-nm/
Prestamos Online Bajo Interes Quien Presta Dinero Rapido Prestamos Por Linea Inmediatos Como Solicitar Un Credito Personal Que Es Un Prestamo Personal
https://prestamosurgente.space/gallup-nm/
Simulador De Prestamos Online Paginas Para Pedir Prestamos Como Pedir El Prestamo De Personal Prestamo 300 Euros Creditos Con Veraz
Creditos Personales Rapidos Prestamos A Credito Solicitar Prestamo Personal Rapido
https://creditosrapidosenusa.space/vallejo-ca/
Credito Al Consumo Como Saber El Credito En Personal Pedir Credito Online Prestamistas Urgentes
https://creditosrapidosenusa.space/boulder-city-nv/
Ofertas Prestamos Personales Mini Prestamos Para Pagar A Plazos Solicitar Credito Personal Un Prestamo Cual Es El Mejor Prestamo Personal
https://creditosrapidosenusa.space/west-palm-beach-fl/
Donde Solicitar Un Credito Personal Prestar Dinero Con Intereses Prestamos En Linea En 24 Horas Donde Prestan Dinero Tasa De Interes Credito Personal
Prestamos Personales Facil Y Rapido Prestamos Personales Con Dni Lugares Para Prestamos De Dinero El Prestamo
https://elprestamista.space/mount-laurel-nj/
Prestamos Dineo Quiero Solicitar Un Prestamo Personal Prestamos Popular Personas Hagan Prestamos Mini Prestamos Personales
https://elprestamista.space/mount-laurel-nj/
Forma Credito Mini Prestamos Sacar Prestamo Online
https://elprestamista.space/midland-tx/
Prestamos Personales Solo Con Dni Ver Prestamos Rapidos Presta Plata Necesito Dinero Microcredito
Prestamos De Dinero Con Dni Quiero Prestamo De Dinero Pedir Prestamo Personal Por Mensaje Busco Prestamista
https://creditosrapidosenusa.space/st-petersburg-fl/
Credito Rapid Prestamos A Domicilio De Dinero Prestamos Rapidos Nuevos Calcular Credito Personal Prestamos Pequenos Y Rapidos
https://creditosrapidosenusa.space/hobbs-nm/
Prestamos Rapidos Y Faciles Prestamos Faciles Por Internet Financieras Para Prestamos Personales Credito Express Online
https://creditosrapidosenusa.space/paradise-nv/
Interes Mas Bajo En Prestamos Personales Prestamos Online En Cuotas Euro Credito En Linea Financieras Creditos Rapidos
Que Es Un Prestamo Personal Prestamos Pequenos Online Prestamos Instantaneos Online Prestamos En Linea Solicito Prestamo De Dinero Urgente
https://prestamosurgente.space/el-cajon-ca/
Como Conseguir Un Prestamo Facil Quiero Hacer Un Prestamo Personal Calcular Cuota De Prestamo Personal Paginas De Prestamos Online Prestamos Urgentes Online
https://prestamosurgente.space/palm-bay-fl/
Calculadora Para Prestamos Personales Busco Prestamos Dinero Financieras Prestamos Express Online Prestamos De Dinero Con Bajo Interes
https://prestamosurgente.space/roswell-ga/
Como Hacer Credito Mejor Banco Prestamo Personal Prestamos Dinero Rapido
Conseguir Prestamo Simulador De Credito De Nomina Consulta De Credito Personal Prestar Dinero Online Para Pedir Un Prestamo
https://prestamosurgente.space/spring-valley-nv/
Micro Prestamos Rapidos Online Solicitar Credito Rapido Solicitar Prestamo Personal Rapido Prestamo De Internet Paginas De Creditos Online
https://prestamosurgente.space/el-paso-tx/
Que Son Los Creditos Prestamistas De Dinero Prestamos De Dinero Inmediato Donde Consigo Un Prestamo Rapido Y Facil
https://prestamosurgente.space/san-antonio-tx/
Necesito Dinero Facil Sacar Prestamo Personal Calcular Cuota Prestamo Personal Solicitar Prestamo Personal Cual Es El Mejor Prestamo Personal