{"id":6744,"date":"2018-03-06T09:25:35","date_gmt":"2018-03-06T08:25:35","guid":{"rendered":"https:\/\/blog.unelink.es\/?p=6744"},"modified":"2019-11-22T11:44:06","modified_gmt":"2019-11-22T10:44:06","slug":"configurar-memcached-para-que-solo-atienda-las-peticiones-de-localhost","status":"publish","type":"post","link":"https:\/\/hosting.airetech.es\/blog\/wiki\/configurar-memcached-para-que-solo-atienda-las-peticiones-de-localhost\/","title":{"rendered":"Configurar Memcached para que solo atienda las peticiones de localhost"},"content":{"rendered":"<p>Si tienes instalado Memcached en tu <a href=\"https:\/\/www.unelink.es\/servidores-dedicados-32.html\" target=\"_blank\" rel=\"noopener noreferrer\">servidor dedicado<\/a> o <a href=\"https:\/\/www.unelink.es\/servidores-virtuales-33.html\" target=\"_blank\" rel=\"noopener noreferrer\">virtual<\/a>, <strong>es una buena pr\u00e1ctica de seguridad que solo atienda las peticiones del propio servidor,\u00a0<\/strong>y as\u00ed evitar que desde fuera puedan utilizarlo para fines maliciosos como, por ejemplo, ataques de amplificaci\u00f3n para denegaciones de servicio.<\/p>\n<p>Para ello tienes que acceder por SSH a tu servidor y editar el fichero\u00a0\/etc\/sysconfig\/memcached<\/p>\n<pre>nano\u00a0\/etc\/sysconfig\/memcached<\/pre>\n<p>En el par\u00e1metro \"OPTIONS\" indica la IP de localhost: 127.0.0.1<\/p>\n<pre>OPTIONS=\"-l 127.0.0.1\"<\/pre>\n<div id=\"attachment_6745\" style=\"width: 676px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/03\/memcached.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6745\" class=\"size-full wp-image-6745\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/03\/memcached.jpg\" alt=\"Memcached\" width=\"666\" height=\"413\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/03\/memcached.jpg 666w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/03\/memcached-300x186.jpg 300w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/03\/memcached-600x372.jpg 600w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><\/a><p id=\"caption-attachment-6745\" class=\"wp-caption-text\">Memcached<\/p><\/div>\n<p>Reinicia el servicio Memcached.<\/p>\n<pre>\/etc\/init.d\/memcached restart<\/pre>\n<p>Y, para verificar que los cambios se han realizado, puedes comprobar que solo atiende a localhost.<\/p>\n<pre>netstat -an | grep 11211\r\ntcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN\r\nudp 0 0 127.0.0.1:11211 0.0.0.0:*<\/pre>\n<div id=\"attachment_6746\" style=\"width: 677px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/03\/comprobacion-memcached.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6746\" class=\" wp-image-6746\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/03\/comprobacion-memcached.jpg\" alt=\"Comprobaci\u00f3n Memcached\" width=\"667\" height=\"347\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/03\/comprobacion-memcached.jpg 794w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/03\/comprobacion-memcached-300x156.jpg 300w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/03\/comprobacion-memcached-768x399.jpg 768w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/03\/comprobacion-memcached-600x312.jpg 600w\" sizes=\"auto, (max-width: 667px) 100vw, 667px\" \/><\/a><p id=\"caption-attachment-6746\" class=\"wp-caption-text\">Comprobaci\u00f3n Memcached<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"Si tienes instalado Memcached en tu servidor dedicado o virtual, es una buena pr\u00e1ctica de seguridad que solo atienda las peticiones del propio servidor,\u00a0y as\u00ed evitar que desde fuera puedan utilizarlo para fines maliciosos como, por ejemplo, ataques de amplificaci\u00f3n para denegaciones de servicio. Para ello tienes que acceder por SSH a tu servidor y editar el fichero\u00a0\/etc\/sysconfig\/memcached nano\u00a0\/etc\/sysconfig\/memcached En&nbsp;<a href=\"https:\/\/hosting.airetech.es\/blog\/wiki\/configurar-memcached-para-que-solo-atienda-las-peticiones-de-localhost\/\" class=\"read-more\">Seguir leyendo<\/a>","protected":false},"author":1,"featured_media":6745,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,7,8,349,507,515,6],"tags":[266,218,213,214],"class_list":["post-6744","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-servidores-dedicados","category-servidores-virtuales-vps","category-ssh","category-ssh-servidores-dedicados","category-ssh-servidores-virtuales-vps","category-wiki","tag-memcached","tag-php","tag-servidores-dedicados","tag-servidores-virtuales-vps","cat-10-id","cat-7-id","cat-8-id","cat-349-id","cat-507-id","cat-515-id","cat-6-id"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/6744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/comments?post=6744"}],"version-history":[{"count":2,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/6744\/revisions"}],"predecessor-version":[{"id":8395,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/6744\/revisions\/8395"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/media\/6745"}],"wp:attachment":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/media?parent=6744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/categories?post=6744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/tags?post=6744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}