Jump to content

Securing Memcached server From UDP Attacks Centos Almalinux RockyLinux


Recommended Posts

In this tutorial we’ll secure Memcached server from UDP attacks which are common now a days, if you’re not using firewall and the memcached port is closed for the world you’re safe from this attacks.

If your Memcached server is only used by your local server then add the below line which will disable UDP  and only listen to localhost IP, which will prevent your server from being exposed on the internet by disabling the UDP protocol. UDP Protocol is now old technology which is not required anymore. TCP is more secure and today all are using it with Memcached.

Edit memcached config file :

nano /etc/sysconfig/memcached


Add this line -l 127.0.0.1 -U 0 under OPTIONS=”” quotes like :

OPTIONS="-l 127.0.0.1,::1 -U 0"


** at the end it will look like this :

PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-l 127.0.0.1,::1 -U 0"


If your Memcached server is binding with ip, add the following OPTIONS line, which will only disable the UDP protocol:

OPTIONS="-U 0"


After that you need to restart the memcached server  and done.

service memcached restart
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...