{"id":165,"date":"2014-04-22T15:49:46","date_gmt":"2014-04-22T07:49:46","guid":{"rendered":"https:\/\/yanjingang.com\/blog\/?p=165"},"modified":"2017-12-28T23:24:14","modified_gmt":"2017-12-28T15:24:14","slug":"centos%e5%bc%80%e5%90%afftp%e5%8f%8a%e9%85%8d%e7%bd%ae%e7%94%a8%e6%88%b7","status":"publish","type":"post","link":"https:\/\/yanjingang.com\/blog\/?p=165","title":{"rendered":"CentOS\u5f00\u542fFTP\u53ca\u914d\u7f6e\u7528\u6237"},"content":{"rendered":"<div>\u00a0<a title=\"vsftpd\" href=\"http:\/\/www.centos.bz\/tag\/vsftpd\/\" target=\"_blank\" rel=\"noopener noreferrer\">vsftpd<\/a>\u4f5c\u4e3aFTP\u670d\u52a1\u5668\uff0c\u5728<a title=\"Linux\" href=\"http:\/\/www.centos.bz\/tag\/linux\/\" target=\"_blank\" rel=\"noopener noreferrer\">Linux<\/a>\u7cfb\u7edf\u4e2d\u662f\u975e\u5e38\u5e38\u7528\u7684\u3002\u4e0b\u9762\u6211\u4eec\u4ecb\u7ecd\u5982\u4f55\u5728<a title=\"centos\" href=\"http:\/\/www.centos.bz\/\" target=\"_blank\" rel=\"noopener noreferrer\">centos<\/a>\u7cfb\u7edf\u4e0a\u5b89\u88c5vsftp\u3002<\/div>\n<h3><a target=\"_blank\" name=\"t0\"><\/a>\u4ec0\u4e48\u662fvsftpd<\/h3>\n<p>vsftpd\u662f\u4e00\u6b3e\u5728Linux\u53d1\u884c\u7248\u4e2d\u6700\u53d7\u63a8\u5d07\u7684FTP\u670d\u52a1\u5668\u7a0b\u5e8f\u3002\u7279\u70b9\u662f\u5c0f\u5de7\u8f7b\u5feb\uff0c\u5b89\u5168\u6613\u7528\u3002<\/p>\n<p>vsftpd \u7684\u540d\u5b57\u4ee3\u8868\u201dvery secure FTP daemon\u201d, \u5b89\u5168\u662f\u5b83\u7684\u5f00\u53d1\u8005 Chris Evans \u8003\u8651\u7684\u9996\u8981\u95ee\u9898\u4e4b\u4e00\u3002\u5728\u8fd9\u4e2a FTP \u670d\u52a1\u5668\u8bbe\u8ba1\u5f00\u53d1\u7684\u6700\u5f00\u59cb\u7684\u65f6\u5019\uff0c\u9ad8\u5b89\u5168\u6027\u5c31\u662f\u4e00\u4e2a\u76ee\u6807\u3002<\/p>\n<h3><a target=\"_blank\" name=\"t1\"><\/a>\u5b89\u88c5vsftpd<\/h3>\n<p><strong>1\u3001\u4ee5\u7ba1\u7406\u5458\uff08root\uff09\u8eab\u4efd\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/strong><\/p>\n<div>\n<ol title=\"Double click to hide line number.\">\n<li>yum install vsftpd<\/li>\n<\/ol>\n<\/div>\n<p><strong>2\u3001\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8vsftpd ftp\u670d\u52a1<\/strong><\/p>\n<div>\n<ol title=\"Double click to show line number.\">\n<li>chkconfig vsftpd on<\/li>\n<\/ol>\n<\/div>\n<p><strong>3\u3001\u542f\u52a8vsftpd\u670d\u52a1<\/strong><\/p>\n<div>\n<ol title=\"Double click to hide line number.\">\n<li>service vsftpd start<\/li>\n<\/ol>\n<\/div>\n<p><strong>\u7ba1\u7406vsftpd\u76f8\u5173\u547d\u4ee4\uff1a<\/strong><\/p>\n<p>\u505c\u6b62vsftpd: \u00a0service vsftpd stop<\/p>\n<p>\u91cd\u542fvsftpd: \u00a0service vsftpd restart<\/p>\n<h3><a target=\"_blank\" name=\"t2\"><\/a>\u914d\u7f6e\u9632\u706b\u5899<\/h3>\n<p>\u6253\u5f00\/etc\/sysconfig\/<a title=\"iptables\" href=\"http:\/\/www.centos.bz\/tag\/iptables\/\" target=\"_blank\" rel=\"noopener noreferrer\">iptables<\/a>\u6587\u4ef6<\/p>\n<div>\n<ol title=\"Double click to hide line number.\">\n<li>vi \/etc\/sysconfig\/iptables<\/li>\n<\/ol>\n<\/div>\n<p>\u5728REJECT\u884c\u4e4b\u524d\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801<\/p>\n<div>\n<ol title=\"Double click to hide line number.\">\n<li>-A RH-Firewall-1-INPUT -m state &#8211;state NEW -m tcp -p tcp &#8211;dport 21 -j ACCEPT<\/li>\n<\/ol>\n<\/div>\n<p>\u4fdd\u5b58\u548c\u5173\u95ed\u6587\u4ef6\uff0c\u91cd\u542f\u9632\u706b\u5899<\/p>\n<div>\n<ol title=\"Double click to hide line number.\">\n<li>service iptables start<\/li>\n<\/ol>\n<\/div>\n<h3><a target=\"_blank\" name=\"t3\"><\/a>\u914d\u7f6evsftpd\u670d\u52a1\u5668<\/h3>\n<p>\u9ed8\u8ba4\u7684\u914d\u7f6e\u6587\u4ef6\u662f\/etc\/vsftpd\/vsftpd.conf\uff0c\u4f60\u53ef\u4ee5\u7528\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00\u3002<\/p>\n<div>\n<ol title=\"Double click to hide line number.\">\n<li>vi \/etc\/vsftpd\/vsftpd.conf<\/li>\n<\/ol>\n<\/div>\n<h3><a target=\"_blank\" name=\"t4\"><\/a>\u6dfb\u52a0ftp\u7528\u6237<\/h3>\n<p>\u4e0b\u9762\u662f\u6dfb\u52a0ftpuser\u7528\u6237\uff0c\u8bbe\u7f6e\u6839\u76ee\u5f55\u4e3a\/home\/wwwroot\/ftpuser,\u7981\u6b62\u6b64\u7528\u6237\u767b\u5f55SSH\u7684\u6743\u9650\uff0c\u5e76\u9650\u5236\u5176\u8bbf\u95ee\u5176\u5b83\u76ee\u5f55\u3002<\/p>\n<p><strong>\uff11\u3001\u4fee\u6539\/etc\/vsftpd\/vsftpd.conf<\/strong><\/p>\n<p>\u5c06\u5e95\u4e0b\u4e09\u884c<\/p>\n<div>\n<ol title=\"Double click to hide line number.\">\n<li>#chroot_list_enable=YES<\/li>\n<li># (default follows)<\/li>\n<li>#chroot_list_file=\/etc\/vsftpd.chroot_list<\/li>\n<\/ol>\n<\/div>\n<p>\u6539\u4e3a<\/p>\n<div>\n<ol title=\"Double click to hide line number.\">\n<li>chroot_list_enable=YES<\/li>\n<li># (default follows)<\/li>\n<li>chroot_list_file=\/etc\/vsftpd\/chroot_list<\/li>\n<\/ol>\n<\/div>\n<p><strong>3\u3001\u589e\u52a0\u7528\u6237ftpuser\uff0c\u6307\u5411\u76ee\u5f55\/home\/wwwroot\/ftpuser,\u7981\u6b62\u767b\u5f55SSH\u6743\u9650\u3002<\/strong><\/p>\n<div>\n<ol title=\"Double click to hide line number.\">\n<li>useradd -d \/home\/wwwroot\/ftpuser -g ftp -s \/sbin\/nologin ftpuser<\/li>\n<\/ol>\n<\/div>\n<p><strong>4\u3001\u8bbe\u7f6e\u7528\u6237\u53e3\u4ee4<\/strong><\/p>\n<div>\n<ol title=\"Double click to hide line number.\">\n<li>passwd ftpuser<\/li>\n<\/ol>\n<\/div>\n<p><strong>5\u3001\u7f16\u8f91\u6587\u4ef6chroot_list:<\/strong><\/p>\n<div>\n<ol title=\"Double click to hide line number.\">\n<li>vi \/etc\/vsftpd\/chroot_list<\/li>\n<\/ol>\n<\/div>\n<p>\u5185\u5bb9\u4e3aftp\u7528\u6237\u540d,\u6bcf\u4e2a\u7528\u6237\u5360\u4e00\u884c,\u5982\uff1a<\/p>\n<p>peter<br \/>\njohn<\/p>\n<p><strong>6\u3001\u91cd\u65b0\u542f\u52a8vsftpd<\/strong><\/p>\n<div>\n<ol title=\"Double click to hide line number.\">\n<li>service vsftpd restart<\/li>\n<\/ol>\n<\/div>\n<p>\u53e6\u5916\uff0c\u5982\u679c\u89c9\u5f97\u4ee5\u540e\u7ba1\u7406ftp\u7528\u6237\u540d\u5acc\u9ebb\u70e6\uff0c\u53ef\u4ee5\u4f7f\u7528centos\u5b98\u65b9\u53d1\u5e03\u7684\u811a\u672c\u7ba1\u7406\u3002\u5730\u5740\u5982\u4e0b\uff1a<\/p>\n<p><a href=\"http:\/\/wiki.centos.org\/HowTos\/Chroot_Vsftpd_with_non-system_users\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/wiki.centos.org\/HowTos\/Chroot_Vsftpd_with_non-system_users<\/a><\/p>\n<h3><a target=\"_blank\" name=\"t5\"><\/a>\u51fa\u73b0\u7684\u9519\u8bef<\/h3>\n<p>1\u3001500 OOPS: cannot change directory<br \/>\n\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<p>\u5728\u7ec8\u7aef\u8f93\u5165\u547d\u4ee4\uff1a<\/p>\n<div>\n<ol title=\"Double click to hide line number.\">\n<li>setsebool -P ftpd_disable_trans 1<\/li>\n<li>service vsftpd restart<\/li>\n<\/ol>\n<\/div>\n<p>\u5c31\uff2f\uff2b\u4e86\uff01<br \/>\n\u539f\u56e0\uff1a\u8fd9\u662f\u56e0\u4e3a\u670d\u52a1\u5668\u5f00\u542f\u4e86selinux\uff0c\u8fd9\u9650\u5236\u4e86FTP\u7684\u767b\u5f55\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>=======================================<\/p>\n<p>proftpd\u7684\u5b89\u88c5\u65b9\u6cd5<\/p>\n<p>http:\/\/www.proftpd.org\/<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\">wget\u00a0ftp:\/\/ftp.proftpd.org\/distrib\/source\/proftpd-1.3.5e.tar.gz\r\ntar zxvf\u00a0proftpd-1.3.5e.tar.gz\r\ncd\u00a0proftpd-1.3.5e\r\n\r\n.\/configure --prefix=\/var\/proftpd --sysconfdir=\/etc\r\nmake\u00a0\r\nmake install\r\n\r\n\/sbin\/service proftpd start\r\nwget ftp:\/\/hostname\/disk\/test.list\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0vsftpd\u4f5c\u4e3aFTP\u670d\u52a1\u5668\uff0c\u5728Linux\u7cfb\u7edf\u4e2d\u662f\u975e\u5e38\u5e38\u7528\u7684\u3002\u4e0b\u9762\u6211\u4eec\u4ecb\u7ecd\u5982\u4f55\u5728centos\u7cfb\u7edf\u4e0a\u5b89\u88c5vsf [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[31],"tags":[140,141,32,481],"_links":{"self":[{"href":"https:\/\/yanjingang.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/165"}],"collection":[{"href":"https:\/\/yanjingang.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yanjingang.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yanjingang.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yanjingang.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=165"}],"version-history":[{"count":0,"href":"https:\/\/yanjingang.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/165\/revisions"}],"wp:attachment":[{"href":"https:\/\/yanjingang.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yanjingang.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yanjingang.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}