Home > Article > Backend Development > memcache security related
Memcache itself does not have a permission control module, so the memcache service open to the external network is easily scanned and discovered by attackers. Sensitive information in memcache can be directly read through command interaction.
To solve this problem, you can follow the following solutions:
1. Memcache is not provided for external network access
memcached -d -m 1024 -u root -l 127.0.0.1 -p 11211 -c 1024 -P /tmp/memcached.pid
2. Memcache needs to be provided for external network access Open the firewall for network access
iptables -A INPUT -p tcp -s 192.168.0.2 --dport 11211 -j ACCEPT
The above rules mean that only the ip 192.168.0.2 is allowed to access port 11211.
The above is the detailed content of memcache security related. For more information, please follow other related articles on the PHP Chinese website!