{"id":6886,"date":"2018-05-22T11:23:03","date_gmt":"2018-05-22T09:23:03","guid":{"rendered":"https:\/\/blog.unelink.es\/?p=6886"},"modified":"2019-11-22T11:42:11","modified_gmt":"2019-11-22T10:42:11","slug":"instalar-servidor-ftp-en-centos-7","status":"publish","type":"post","link":"https:\/\/hosting.airetech.es\/blog\/wiki\/instalar-servidor-ftp-en-centos-7\/","title":{"rendered":"Instalar servidor FTP en CentOS 7"},"content":{"rendered":"<p>Si tienes un <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\">VPS<\/a> con CentOS 7 y necesitas <strong>instalar un servidor FTP<\/strong>, en esta gu\u00eda os contamos paso a paso c\u00f3mo hacerlo.<\/p>\n<p>Lo primero de todo, si acabas de instalar el sistema operativo, lo ideal ser\u00eda que lo actualizaras para tener los paquetes en la \u00faltima versi\u00f3n. Sin embargo, si el servidor est\u00e1 en producci\u00f3n, tienes que valorar si la actualizaci\u00f3n te podr\u00eda causar problemas.<\/p>\n<p>Si decides actualizar CentOS, puedes hacerlo usando el siguiente comando:<\/p>\n<pre>yum -y update<\/pre>\n<p>El siguiente paso es instalar el servidor FTP. En esta entrada <strong>vamos a utilizar el FTP vsftpd<\/strong>. Para instalarlo utiliza el gestor de paquetes yum:<\/p>\n<pre>yum install vsftpd<\/pre>\n<div id=\"attachment_6892\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/01-instalacion-vsftpd.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6892\" class=\"wp-image-6892\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/01-instalacion-vsftpd.jpg\" alt=\"Instalaci\u00f3n vsftpd\" width=\"650\" height=\"651\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/01-instalacion-vsftpd.jpg 667w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/01-instalacion-vsftpd-150x150.jpg 150w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/01-instalacion-vsftpd-300x300.jpg 300w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/01-instalacion-vsftpd-600x601.jpg 600w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/01-instalacion-vsftpd-144x144.jpg 144w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/a><p id=\"caption-attachment-6892\" class=\"wp-caption-text\">Instalaci\u00f3n vsftpd<\/p><\/div>\n<p>Una vez instalado, <strong>configura el servicio para que se arranque autom\u00e1ticamente<\/strong> al iniciar el sistema operativo.<\/p>\n<pre>systemctl enable vsftpd.service<\/pre>\n<div id=\"attachment_6891\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/02-activar-servicio.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6891\" class=\"wp-image-6891\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/02-activar-servicio.jpg\" alt=\"Activar FTP\" width=\"650\" height=\"109\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/02-activar-servicio.jpg 666w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/02-activar-servicio-300x50.jpg 300w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/02-activar-servicio-600x101.jpg 600w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/a><p id=\"caption-attachment-6891\" class=\"wp-caption-text\">Activar FTP<\/p><\/div>\n<p>Ahora <strong>cambia la configuraci\u00f3n del servicio FTP para que funcione mejor y aportarle m\u00e1s seguridad<\/strong>. El fichero de configuraci\u00f3n se encuentra en la siguiente ruta:<\/p>\n<pre>\/etc\/vsftpd\/vsftpd.conf<\/pre>\n<p>Recuerda que, si delante de una l\u00ednea est\u00e1 el car\u00e1cter \"#\", dicha opci\u00f3n est\u00e1 deshabilitada por lo que no funcionar\u00e1. Para que funcione hay que eliminar dicho car\u00e1cter.<\/p>\n<p>Por defecto, las opciones \"local_enable\" y \"write_enable\" est\u00e1n descomentadas y con valor YES. Si no los tienes as\u00ed, tienes que descomentarlas quitando el car\u00e1cter \"#\" y poner el valor YES.<\/p>\n<div id=\"attachment_6890\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/03-conf.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6890\" class=\"wp-image-6890\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/03-conf.jpg\" alt=\"Configuraci\u00f3n\" width=\"650\" height=\"653\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/03-conf.jpg 666w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/03-conf-150x150.jpg 150w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/03-conf-300x300.jpg 300w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/03-conf-600x603.jpg 600w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/03-conf-144x144.jpg 144w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/a><p id=\"caption-attachment-6890\" class=\"wp-caption-text\">Configuraci\u00f3n<\/p><\/div>\n<p>Lo m\u00e1s normal es que quieras que los usuarios accedan al FTP con un usuario y contrase\u00f1a, por lo que\u00a0 tienes que <strong>desactivar la conexi\u00f3n an\u00f3nima al servidor FTP<\/strong>. Para hacerlo cambia el valor YES por NO.<\/p>\n<p>Por \u00faltimo, si quieres restringir que cada usuario tenga su carpeta personal y no pueda acceder a todo el servidor, busca la l\u00ednea \"chroot_local_user\", comprueba que est\u00e1 descomentada y que tenga el valor YES.<\/p>\n<p>Tras aplicar los cambios y guardar el fichero de configuraci\u00f3n, <strong>arranca (o reinicia) el servicio vsftpd<\/strong> para que se apliquen los cambios.<\/p>\n<p>Para reiniciar el servicio ejecuta el comando:<\/p>\n<pre>systemctl restart vsftpd.service<\/pre>\n<p>Para arrancarlo utiliza el comando:<\/p>\n<pre>systemctl start vsftpd.service<\/pre>\n<p>Si tienes CentOS 7, es muy probable que tengas iptables activado, por lo que tienes que <strong>a\u00f1adir una regla que permita la conexi\u00f3n entrante al FTP desde el exterior<\/strong>. Para permitir las conexiones utiliza el siguiente comando:<\/p>\n<pre>iptables -I INPUT 5 -p tcp --dport 21 -m state --state NEW -j ACCEPT<\/pre>\n<p>A parte de esto, <strong>comprueba que tienes cargado el m\u00f3dulo \"ip_conntrack_ftp\" para iptables<\/strong>. Para comprobarlo accede al fichero de configuraci\u00f3n de iptables<br \/>\nque se encuentra en el archivo:<\/p>\n<pre>\/etc\/sysconfig\/iptables-config<\/pre>\n<p>Busca la opci\u00f3n en el archivo de configuraci\u00f3n y d\u00e9jalo de la siguiente manera:<\/p>\n<pre>IPTABLES_MODULES=\"ip_conntrack_ftp\"<\/pre>\n<p>Es posible que en esta opci\u00f3n tengas m\u00e1s contenido. De ser as\u00ed, tienes que a\u00f1adir el valor \"ip_conntrack_ftp\" separado por espacios.<\/p>\n<pre>IPTABLES_MODULES=\"modulo1 modulo2 ip_conntrack_ftp\"<\/pre>\n<div id=\"attachment_6893\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/04-iptables.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6893\" class=\"wp-image-6893\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/04-iptables.jpg\" alt=\"Iptables\" width=\"650\" height=\"653\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/04-iptables.jpg 666w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/04-iptables-150x150.jpg 150w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/04-iptables-300x300.jpg 300w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/04-iptables-600x603.jpg 600w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/05\/04-iptables-144x144.jpg 144w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/a><p id=\"caption-attachment-6893\" class=\"wp-caption-text\">Iptables<\/p><\/div>\n<p>Tras hacer los cambios, <strong>reinicia iptables<\/strong>:<\/p>\n<pre>systemctl restart iptables.service<\/pre>\n<p>Tras estos pasos <strong>ya tendr\u00edas un servidor FTP instalado<\/strong> en tu servidor con CentOS 7.<\/p>\n","protected":false},"excerpt":{"rendered":"Si tienes un servidor dedicado o VPS con CentOS 7 y necesitas instalar un servidor FTP, en esta gu\u00eda os contamos paso a paso c\u00f3mo hacerlo. Lo primero de todo, si acabas de instalar el sistema operativo, lo ideal ser\u00eda que lo actualizaras para tener los paquetes en la \u00faltima versi\u00f3n. Sin embargo, si el servidor est\u00e1 en producci\u00f3n, tienes&nbsp;<a href=\"https:\/\/hosting.airetech.es\/blog\/wiki\/instalar-servidor-ftp-en-centos-7\/\" class=\"read-more\">Seguir leyendo<\/a>","protected":false},"author":1,"featured_media":6894,"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,507,515,6],"tags":[110,19,216,213,214],"class_list":["post-6886","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-servidores-dedicados","category-servidores-virtuales-vps","category-ssh-servidores-dedicados","category-ssh-servidores-virtuales-vps","category-wiki","tag-centos","tag-ftp","tag-linux","tag-servidores-dedicados","tag-servidores-virtuales-vps","cat-10-id","cat-7-id","cat-8-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\/6886","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=6886"}],"version-history":[{"count":4,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/6886\/revisions"}],"predecessor-version":[{"id":9059,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/6886\/revisions\/9059"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/media\/6894"}],"wp:attachment":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/media?parent=6886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/categories?post=6886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/tags?post=6886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}