2\uff1a\u521b\u5efaftp\u670d\u52a1\u7aef\u5bf9\u5e94\u7684\u7528\u6237<\/strong><\/div>\n\u6211\u4eec\u77e5\u9053\uff0cftp\u670d\u52a1\u5668\uff0c\u53ef\u80fd\u4f1a\u63d0\u4f9b\u51fa\u53bb(\u867d\u7136\u51ef\u54e5\u8fd9\u91cc\u4e0d\u4f1a\u63d0\u4f9b\u51fa\u53bb)\uff0c\u7ed9\u5176\u4ed6\u7684\u4e09\u65b9\u4eba\u5458\u4f7f\u7528\uff0c\u4ece\u6570\u636e\u53ca\u670d\u52a1\u5668\u5b89\u5168\u89d2\u5ea6\u6765\u8003\u8651\uff0c\u6211\u4eec\u7ed9ftp\u670d\u52a1\u4e00\u4e2a\u5355\u72ec\u7684\u7528\u6237\u3002\u8fd9\u4e2a\u7528\u6237\u5c31\u662f\u7528\u6765\u767b\u5f55ftp\u670d\u52a1\u5668\u4f7f\u7528\u7684\u3002<\/p>\n
\u7528\u6237\u53ef\u4ee5\u4efb\u610f\u3002\u8fd9\u91cc\u54b1\u4eec\u5c31\u628a\u8fd9\u4e2a\u7528\u6237\u53ebftpuser\u5427\uff0cLinux\u6dfb\u52a0\u7528\u6237\u7684\u547d\u4ee4\u516c\u5f0f\uff1auseradd \u7528\u6237\u540d\u3002\u90a3\u4e48\uff0c\u54b1\u4eec\u5c31\u5957\u7528\u516c\u5f0f\uff0c\u5bf9\u5e94\u7684\u6dfb\u52a0\u7528\u6237\u547d\u4ee4\u5c31\u662f\uff1a<\/p>\n
useradd ftpuser<\/pre>\n\u7ed9\u65b0\u6dfb\u52a0\u7684\u7528\u6237ftpuser\u6dfb\u52a0\u5bc6\u7801\u3002Linux\u7ed9\u67d0\u4e2a\u7528\u6237\u6dfb\u52a0\u5bc6\u7801\u7684\u547d\u4ee4\u516c\u5f0f\uff1apasswd \u7528\u6237\u540d\u3002\u6240\u4ee5\uff0c\u54b1\u4eec\u5957\u7528\u8fd9\u4e2a\u6dfb\u52a0\u7528\u6237\u7684\u516c\u5f0f\u540e\u547d\u4ee4\u5c31\u662f\uff1a<\/p>\n
passwd ftpuser<\/pre>\n\u8f93\u5165\u4e24\u6b21\u5bc6\u7801\u540e\uff0c\u5c31\u4fee\u6539\u5bc6\u7801\u6210\u529f\u4e86\u3002
\n\u8fd9\u6837\u4e00\u7528\u6237\u5c31\u65b0\u5efa\u5b8c\u6210\u4e86\u3002\u521b\u5efa\u4e4b\u540e\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e2a\u7528\u6237\u540d\u53ca\u5bc6\u7801\u767b\u5f55\u3002\u767b\u5f55\u540e\u9ed8\u8ba4\u7684\u8bbf\u95ee\u8def\u5f84\u5c31\u662f\uff1a\/home\/ftpuser<\/p>\n
3\uff1a\u5f00\u653e\u5bf9\u5e94\u7684\u7aef\u53e3<\/strong><\/div>\n\u56e0\u4e3a\u8fd9\u91cc\u4f7f\u7528\u7684\u662f\u4e91\u670d\u52a1\u5668\uff0c\u5c31\u627e\u5230\u5bf9\u5e94\u7684\u5b89\u5168\u7b56\u7565\u7ec4\uff0c\u628a21\u548c22\u7aef\u53e3\u653e\u5f00\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n
\u5728\u5bf9\u5e94\u7684\u670d\u52a1\u5668\u8be6\u60c5\u4e2d\uff0c\u627e\u5230\u5b89\u5168\u7ec4A\u67d0\u4e91)\u6216\u8005\u627e\u5230\u9632\u706b\u5899(T\u67d0\u4e91)\uff0c\u56e0\u4e3a\u51ef\u54e5\u8fd9\u91cc\u4f7f\u7528\u7684\u662fT\u67d0\u4e91\u3002\u6240\u4ee5\u5c31\u5982\u4e0b\u56fe\u6240\u793a\u4e86\u3002\u70b9\u51fb\u6dfb\u52a0\u89c4\u5219\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n
<\/p>\n
\u5982\u679c\u662f\u81ea\u5df1\u672c\u5730\u7684\uff0c\u53ef\u4ee5\u628a\u9632\u706b\u5899\u768421\u548c22\u7aef\u53e3\u6253\u5f00\u3002\u8fd9\u91cc\u5c31\u4e0d\u8d58\u8ff0\u4e86\u3002<\/p>\n
4\uff1aselinux\u5f97\u4fee\u6539<\/strong><\/div>\n\u4e00\u822c\u662f\u65b0\u670d\u52a1\u5668\u7684\u8bdd\uff0cselinux\u662f\u81ea\u52a8\u5173\u95ed\u7684\u3002\u6ca1\u6709\u5f00\u542f\u72b6\u6001\u3002\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a<\/p>\n
getsebool -a |grep ftp<\/pre>\n<\/p>\n
\u53ef\u4ee5\u770b\u5230\uff0cSElinux isdisabled\u3002<\/p>\n
\u5982\u679c\u4f60\u7684\u670d\u52a1\u5668\u4e0a\uff0cSElinux\u662f\u5f00\u542f\u7684\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\uff0c\u5916\u7f51\u53ef\u4ee5\u8bbf\u95ee\uff0c\u6ca1\u76ee\u5f55\u8fd4\u56de\uff0c\u4e14\u4e5f\u4e0a\u4f20\u4e0d\u4e86\u3002\u8fd9\u5c31\u662fSElinux\u7684\u539f\u56e0\u3002\u5904\u7406\u529e\u6cd5\uff1a<\/p>\n
<\/p>\n
\u5728\u6267\u884c\u5b8c\u4e0a\u9762\u547d\u4ee4\u540e\uff0c\u5982\u679c\u8fd4\u56de\u7ed3\u679c\u4e2d\uff0c\u770b\u5230\u4e0a\u56fe\u9ad8\u4eae\u7684\u4e24\u4e2a\u662foff\u7684\u8bdd\uff0c\u5c31\u4ee3\u8868\uff0c\u6ca1\u6709\u5f00\u542f\u5916\u7f51\u8bbf\u95ee\u3002\u4f7f\u7528\u4e0b\u9762\u547d\u4ee4\uff1a<\/p>\n
setsebool -P allow_ftpd_full_access on\r\nsetsebool -P ftp_home_dir on<\/pre>\n\u5c06\u8fd9\u4e24\u4e2a\u8bbe\u7f6e\u4e3aon\u3002<\/p>\n
5\uff1avsftpd.conf\u7684\u914d\u7f6e<\/strong><\/div>\n\u5173\u95ed\u533f\u540d\u8bbf\u95ee\u6743\u9650
\n\u5728\/etc\/vsftpd\/vsftpd.conf\u6587\u4ef6\u4e2d\u627e\u5230\uff1aanonymous_enable=YES\u3002\u5c06\u8fd9\u4e2aYES\u4fee\u6539\u6210NO\u3002<\/p>\n
<\/p>\n
\u4fee\u6539\u4e4b\u540e\uff0c\u91cd\u542fftp\u670d\u52a1\u3002\u91cd\u542f\u547d\u4ee4\uff1a<\/p>\n
service vsftpd restart<\/pre>\n6\uff1a\u542f\u52a8\u88ab\u52a8\u6a21\u5f0f<\/strong><\/div>\n\u8fd9\u4e2a\u88ab\u52a8\u9ed8\u8ba4\u662f\u5f00\u542f\u7684\u3002\u4f46\u662f\uff0c\u88ab\u52a8\u7684\u7aef\u53e3\uff0c\u53ef\u80fd\u662f\u968f\u673a\u7684\u3002\u6240\u4ee5\uff0c\u6211\u4eec\u9700\u8981\u7ed9\u5b9a\u4e00\u4e2a\u7aef\u53e3\u8303\u56f4\u3002\u540c\u6837\uff0c\u5728vsftp.conf\u6587\u4ef6\u4e2d\u4fee\u6539\u3002\u5728\u8fd9\u4e2a\u6587\u4ef6\u7684\u6700\u540e\u9762\u52a0\u4e0a\uff1a<\/p>\n
pasv_min_port=30000\r\npasv_max_port=30999<\/pre>\n\u8fd9\u4e2a\u7aef\u53e3\u8303\u56f4\uff0c\u53ef\u4ee5\u968f\u610f\u7ed9\u5b9a\uff0c\u9700\u8981\u6ce8\u610f\uff0c1\uff1a\u4e0d\u80fd\u548c\u5176\u4ed6\u7aef\u53e3\u51b2\u7a81\uff1b2\uff1a\u6dfb\u52a0\u5b8c\u6210\u4e4b\u540e\uff0c\u8bb0\u5f97\u91cd\u542fvsftp\u670d\u52a1\u3002<\/p>\n
\u56e0\u4e3a\u65b0\u589e\u52a0\u4e86\u7aef\u53e3\u8303\u56f4\uff0c\u6240\u4ee5\uff0c\u540c\u6837\u9700\u8981\u5728\u5b89\u5168\u7ec4\u7b56\u7565\u6216\u8005\u9632\u706b\u5899\u5c06\u5bf9\u5e94\u7aef\u53e3\u6253\u5f00\u3002<\/p>\n
7\uff1a\u5c06VSFTPD\u7684FTP\u670d\u52a1\u8bbe\u7f6e\u6210\u5f00\u673a\u542f\u52a8<\/strong><\/div>\n\u5982\u679c\uff0c\u4f60\u4e0d\u884c\uff0c\u670d\u52a1\u5668\u91cd\u542f\u4e4b\u540e\uff0cFTP\u670d\u52a1\u5c31\u4e0d\u80fd\u8bbf\u95ee\uff0c\u6216\u8005\u6bcf\u6b21\u91cd\u542f\u670d\u52a1\u5668\u4e4b\u540e\uff0c\u90fd\u9700\u8981\u624b\u52a8\u542f\u52a8VSFTPD\u7684\u8bdd\uff0c\u53ef\u4ee5\u5c06VSFTPD\u8bbe\u7f6e\u6210\u968f\u673a\u542f\u52a8\u7684\u3002\u4f7f\u7528\u547d\u4ee4\uff1a<\/p>\n
chkconfig vsftpd on<\/pre>\n8\uff1a\u9a8c\u8bc1<\/strong><\/div>\n\u4ee5\u4e0a\u51e0\u6b65\u64cd\u4f5c\u5b8c\u6574\u4e4b\u540e\uff0c\u53ef\u4ee5\u8fdb\u884c\u9a8c\u8bc1\u4e86\u3002\u5728ftp\u76ee\u5f55\u4e0b\u6dfb\u52a0\u4e00\u4e2ajpg\u6587\u4ef6\u3002\u7136\u540e\u901a\u8fc7ip\u6216\u8005\u662f\u914d\u7f6e\u4e86Nginx\u53cd\u5411\u4ee3\u7406\u7684\u8bdd\uff0c\u53ef\u4ee5\u901a\u8fc7\u57df\u540d\u6216\u8005Nginx\u7684ip\u8bbf\u95ee\u8bd5\u8bd5\u3002<\/p>\n
\u5728\u64cd\u4f5c\u65f6\u5019\uff0c\u9047\u5230\u7684\u95ee\u9898\u5982\u4e0b\uff1a<\/strong><\/div>\n\u2460\uff1a\u4f7f\u7528\u4ee3\u7801\u4e0a\u4f20
\n\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u9ed8\u8ba4\u662f21\u7aef\u53e3\u3002\u5982\u679c21\u7aef\u53e3\u4e0a\u4f20\u4e0d\u4e86\uff0c\u4f60\u53ef\u4ee5\u5207\u6362\u621022\u7aef\u53e3\u8bd5\u8bd5\u3002<\/p>\n
\u2461\uff1a\u56fe\u7247\u4e0a\u4f20\u540e\uff0c\u8bbf\u95ee\u4e0d\u4e86\uff1a
\n\u4fee\u6539\/etc\/vsftpd\/ftpuser<\/p>\n
ftpusers\u91cc\u9762\u662fftp\u9ed8\u8ba4\u62d2\u7edd\u7684\u7528\u6237\uff0c\u5982\u679c\u8981\u60f3\u7cfb\u7edf\u7528\u6237\uff0c\u5c31\u628a\u8fd9\u4e2a\u7528\u6237\u4eceftpusers\u6587\u4ef6\u4e2d\u5220\u9664\u3002<\/p>\n
\u5728\u8fd9\u91cc\u8981\u6ce8\u610f\uff0c\u4e0d\u8981\u628a\/etc\/pam.d\/vsftpd\u91cc\u9762\u7684deny\u6539\u6210allow\uff0c\u4e0d\u7136\u4f60\u81ea\u5df1\u5efa\u7acb\u7684\u7528\u6237\u5c31\u4f1a\u62a5530 Login incorrect<\/p>\n","protected":false},"excerpt":{"rendered":"
\u4f7f\u7528yum\u547d\u4ee4\u5b89\u88c5\u3002\u5b89\u88c5\u547d\u4ee4\u5982\u4e0b: yum -y install vsftpd \u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\uff0c\u4f1a\u5728\/etc\u76ee\u5f55 […]<\/p>\n","protected":false},"author":310,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-261570","post","type-post","status-publish","format-standard","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/261570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/310"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=261570"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/261570\/revisions"}],"predecessor-version":[{"id":261581,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/261570\/revisions\/261581"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=261570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=261570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=261570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}