{"id":338,"date":"2012-01-04T17:27:19","date_gmt":"2012-01-04T09:27:19","guid":{"rendered":"http:\/\/www.woria.cn\/blogs\/?p=338"},"modified":"2012-01-04T17:27:19","modified_gmt":"2012-01-04T09:27:19","slug":"yum-install-vsftp-vuser","status":"publish","type":"post","link":"https:\/\/blogs.woria.cn\/?p=338","title":{"rendered":"yum install vsftp \u914d\u7f6e\u865a\u62df\u7528\u6237\u7ec8\u6781\u653b\u7565"},"content":{"rendered":"<p>\u4e00.\u5b89\u88c5\uff1a<br \/>\n1.\u5b89\u88c5Vsftpd\u670d\u52a1\u76f8\u5173\u90e8\u4ef6\uff1a<br \/>\n[root@KcentOS5 ~]# yum install vsftpd*<\/p>\n<p>2.\u786e\u8ba4\u5b89\u88c5PAM\u670d\u52a1\u76f8\u5173\u90e8\u4ef6\uff1a<br \/>\n[root@KcentOS5 ~]# yum install pam*<br \/>\n\u5f00\u53d1\u5305\uff0c\u5176\u5b9e\u4e0d\u88c5\u4e5f\u6ca1\u6709\u5173\u7cfb\uff0c\u4e3b\u8981\u7684\u76ee\u7684\u662f\u786e\u8ba4PAM\u3002<\/p>\n<p>3.\u5b89\u88c5DB4\u90e8\u4ef6\u5305\uff1a<br \/>\n\u8fd9\u91cc\u8981\u7279\u522b\u5b89\u88c5\u4e00\u4e2adb4\u7684\u5305\uff0c\u7528\u6765\u652f\u6301\u6587\u4ef6\u6570\u636e\u5e93\u3002<br \/>\n[root@KcentOS5 ~]# yum install db4*<\/p>\n<p>\u4e8c.\u7cfb\u7edf\u5e10\u6237<br \/>\n1.\u5efa\u7acbVsftpd\u670d\u52a1\u7684\u5bbf\u4e3b\u7528\u6237\uff1a<br \/>\n[root@KcentOS5 ~]# useradd vsftpd -s \/sbin\/nologin<br \/>\n     \u9ed8\u8ba4\u7684Vsftpd\u7684\u670d\u52a1\u5bbf\u4e3b\u7528\u6237\u662froot\uff0c\u4f46\u662f\u8fd9\u4e0d\u7b26\u5408\u5b89\u5168\u6027\u7684\u9700\u8981\u3002\u8fd9\u91cc\u5efa\u7acb\u540d\u5b57\u4e3avsftpd\u7684\u7528\u6237\uff0c\u7528\u4ed6\u6765\u4f5c\u4e3a\u652f\u6301Vsftpd\u7684\u670d\u52a1\u5bbf\u4e3b\u7528\u6237\u3002\u7531\u4e8e\u8be5\u7528\u6237\u4ec5\u7528\u6765\u652f\u6301Vsftpd\u670d\u52a1\u7528\uff0c\u56e0\u6b64\u6ca1\u6709\u8bb8\u53ef\u4ed6\u767b\u9646\u7cfb\u7edf\u7684\u5fc5\u8981\uff0c\u5e76\u8bbe\u5b9a\u4ed6\u4e3a\u4e0d\u80fd\u767b\u9646\u7cfb\u7edf\u7684\u7528\u6237\u3002<br \/>\n<!--more--><br \/>\n2.\u5efa\u7acbVsftpd\u865a\u62df\u5bbf\u4e3b\u7528\u6237\uff1a<br \/>\n[root@KcentOS5 nowhere]# useradd overlord -s \/sbin\/nologin<br \/>\n    \u672c\u7bc7\u4e3b\u8981\u662f\u4ecb\u7ecdVsftp\u7684\u865a\u62df\u7528\u6237\uff0c\u865a\u62df\u7528\u6237\u5e76\u4e0d\u662f\u7cfb\u7edf\u7528\u6237\uff0c\u4e5f\u5c31\u662f\u8bf4\u8fd9\u4e9bFTP\u7684\u7528\u6237\u5728\u7cfb\u7edf\u4e2d\u662f\u4e0d\u5b58\u5728\u7684\u3002\u4ed6\u4eec\u7684\u603b\u4f53\u6743\u9650\u5176\u5b9e\u662f\u96c6\u4e2d\u5bc4\u6258\u5728\u4e00\u4e2a\u5728\u7cfb\u7edf\u4e2d\u7684\u67d0\u4e00\u4e2a\u7528\u6237\u8eab\u4e0a\u7684\uff0c\u6240\u8c13Vsftpd\u7684\u865a\u62df\u5bbf\u4e3b\u7528\u6237\uff0c\u5c31\u662f\u8fd9\u6837\u4e00\u4e2a\u652f\u6301\u7740\u6240\u6709\u865a\u62df\u7528\u6237\u7684\u5bbf\u4e3b\u7528\u6237\u3002\u7531\u4e8e\u4ed6\u652f\u6491\u4e86FTP\u7684\u6240\u6709\u865a\u62df\u7684\u7528\u6237\uff0c\u90a3\u4e48\u4ed6\u672c\u8eab\u7684\u6743\u9650\u5c06\u4f1a\u5f71\u54cd\u7740\u8fd9\u4e9b\u865a\u62df\u7684\u7528\u6237\uff0c\u56e0\u6b64\uff0c\u5904\u4e8e\u5b89\u5168\u6027\u7684\u8003\u8651\uff0c\u4e5f\u8981\u975e\u5206\u6ce8\u610f\u5bf9\u8be5\u7528\u6237\u7684\u6743\u9650\u7684\u63a7\u5236\uff0c\u8be5\u7528\u6237\u4e5f\u7edd\u5bf9\u6ca1\u6709\u767b\u9646\u7cfb\u7edf\u7684\u5fc5\u8981\uff0c\u8fd9\u91cc\u4e5f\u8bbe\u5b9a\u4ed6\u4e3a\u4e0d\u80fd\u767b\u9646\u7cfb\u7edf\u7684\u7528\u6237\u3002<br \/>\n\uff08\u8fd9\u91cc\u63d2\u4e00\u53e5\uff1a\u539f\u672c\u5728\u5efa\u7acb\u4e0a\u9762\u4e24\u4e2a\u7528\u6237\u7684\u65f6\u5019\uff0c\u60f3\u8fde\u7528\u6237\u4e3b\u8def\u5f84\u4e5f\u4e0d\u6253\u7b97\u7ed9\u7684\u3002\u672c\u6765\u60f3\u52a0\u4e0a -d \/home\/nowhere \u7684\uff0c\u636eman useradd\u624b\u518c\u4e0a\u8bb2<br \/>\n\u8ff0\uff1a\u201c       -d, &#8211;home HOME_DIR<br \/>\n          The new user will be created using HOME_DIR as the value for the<br \/>\n          user\u9219 login directory. The default is to append the LOGIN name to<br \/>\n          BASE_DIR and use that as the login directory name. The directory<br \/>\n          HOME_DIR does not have to exist but will not be created if it is<br \/>\n          missing.<br \/>\n\u4f7f\u7528-d\u53c2\u6570\u6307\u5b9a\u7528\u6237\u7684\u4e3b\u76ee\u5f55\uff0c\u7528\u6237\u4e3b\u76ee\u5f55\u5e76\u4e0d\u662f\u5fc5\u987b\u5b58\u5728\u7684\u3002\u5982\u679c\u6ca1\u6709\u5b58\u5728\u6307\u5b9a\u7684\u76ee\u5f55\u7684\u8bdd\uff0c\u90a3\u4e48\u5b83\u5c06\u4e0d\u4f1a\u88ab\u5efa\u7acb\u201d\u3002\u7ed3\u679c\u6211\u5c1d\u8bd5 -d \/home\/nowhere \u6307\u5b9a\u5230\u4e00\u4e2a\u5e76\u4e0d\u5b58\u5728\u7684\u76ee\u5f55\u7684\u65f6\u5019\uff0c\u6211KAO\uff01\u7adf\u7136\u7ed9\u6211\u81ea\u5df1\u65b0\u5efa\u4e86\u4e00\u4e2a= =\uff03\uff09<\/p>\n<p>\u4e09.\u8c03\u6574Vsftpd\u7684\u914d\u7f6e\u6587\u4ef6\uff1a<br \/>\n1.\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\u524d\u5148\u5907\u4efd<br \/>\n[root@KcentOS5 ~]# cp \/etc\/vsftpd\/vsftpd.conf \/etc\/vsftpd\/vsftpd.conf.backup<\/p>\n<p>2.\u7f16\u8f91\u4e3b\u914d\u7f6e\u6587\u4ef6Vsftpd.conf<br \/>\n[root@KcentOS5 ~]# vi \/etc\/vsftpd\/vsftpd.conf<br \/>\n\u8fd9\u91cc\u6211\u5c06\u539f\u914d\u7f6e\u6587\u4ef6\u7684\u4fee\u6539\u5b8c\u5168\u8bb0\u5f55\uff0c\u51e1\u662f\u4fee\u6539\u7684\u5730\u65b9\u6211\u90fd\u4f1a\u4fdd\u7559\u6ce8\u91ca\u539f\u6765\u7684\u914d\u7f6e\u3002\u5176\u4e2d\u52a0\u5165\u6211\u5bf9\u6bcf\u6761\u914d\u7f6e\u9879\u7684\u8ba4\u8bc6\uff0c\u5bf9\u4e8e\u4e00\u4e9b\u6bd4\u8f83\u5173\u952e\u7684\u914d\u7f6e\u9879\u8fd9\u91cc\u6211\u505a\u4e86\u6211\u7684\u89c2\u70b9\uff0c\u5e76\u4e14\u539f\u672c\u82f1\u8bed\u7684\u8bf4\u660e\u6211\u4e5f\u4e0d\u5220\u9664\uff0c\u4f9b\u53c2\u8003\u5bf9\u6bd4\u7528\u3002<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n# Example config file \/etc\/vsftpd\/vsftpd.conf<br \/>\n#<br \/>\n# The default compiled in settings are fairly paranoid. This sample file<br \/>\n# loosens things up a bit, to make the ftp daemon more usable.<br \/>\n# Please see vsftpd.conf.5 for all compiled in defaults.<br \/>\n#<br \/>\n# READ THIS: This example file is NOT an exhaustive list of vsftpd options.<br \/>\n# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd&#8217;s<br \/>\n# capabilities.<br \/>\n#<br \/>\n# Allow anonymous FTP? (Beware &#8211; allowed by default if you comment this out).<br \/>\n#anonymous_enable=YES<br \/>\nanonymous_enable=NO<br \/>\n\u8bbe\u5b9a\u4e0d\u5141\u8bb8\u533f\u540d\u8bbf\u95ee<br \/>\n#<br \/>\n# Uncomment this to allow local users to log in.<br \/>\nlocal_enable=YES<br \/>\n\u8bbe\u5b9a\u672c\u5730\u7528\u6237\u53ef\u4ee5\u8bbf\u95ee\u3002\u6ce8\u610f\uff1a\u4e3b\u8981\u662f\u4e3a\u865a\u62df\u5bbf\u4e3b\u7528\u6237\uff0c\u5982\u679c\u8be5\u9879\u76ee\u8bbe\u5b9a\u4e3aNO\u90a3\u4e48\u6240\u6709\u865a\u62df\u7528\u6237\u5c06\u65e0\u6cd5\u8bbf\u95ee\u3002<br \/>\n#<br \/>\n# Uncomment this to enable any form of FTP write command.<br \/>\nwrite_enable=YES<br \/>\n\u8bbe\u5b9a\u53ef\u4ee5\u8fdb\u884c\u5199\u64cd\u4f5c\u3002<br \/>\n#<br \/>\n# Default umask for local users is 077. You may wish to change this to 022,<br \/>\n# if your users expect that (022 is used by most other ftpd&#8217;s)<br \/>\nlocal_umask=022<br \/>\n\u8bbe\u5b9a\u4e0a\u4f20\u540e\u6587\u4ef6\u7684\u6743\u9650\u63a9\u7801\u3002<br \/>\n#<br \/>\n# Uncomment this to allow the anonymous FTP user to upload files. This only<br \/>\n# has an effect if the above global write enable is activated. Also, you will<br \/>\n# obviously need to create a directory writable by the FTP user.<br \/>\n#anon_upload_enable=YES<br \/>\nanon_upload_enable=NO<br \/>\n\u7981\u6b62\u533f\u540d\u7528\u6237\u4e0a\u4f20\u3002<br \/>\n#<br \/>\n# Uncomment this if you want the anonymous FTP user to be able to create<br \/>\n# new directories.<br \/>\n#anon_mkdir_write_enable=YES<br \/>\nanon_mkdir_write_enable=NO<br \/>\n\u7981\u6b62\u533f\u540d\u7528\u6237\u5efa\u7acb\u76ee\u5f55\u3002<br \/>\n#<br \/>\n# Activate directory messages &#8211; messages given to remote users when they<br \/>\n# go into a certain directory.<br \/>\ndirmessage_enable=YES<br \/>\n\u8bbe\u5b9a\u5f00\u542f\u76ee\u5f55\u6807\u8bed\u529f\u80fd\u3002<br \/>\n#<br \/>\n# Activate logging of uploads\/downloads.<br \/>\nxferlog_enable=YES<br \/>\n\u8bbe\u5b9a\u5f00\u542f\u65e5\u5fd7\u8bb0\u5f55\u529f\u80fd\u3002<br \/>\n#<br \/>\n# Make sure PORT transfer connections originate from port 20 (ftp-data).<br \/>\nconnect_from_port_20=YES<br \/>\n\u8bbe\u5b9a\u7aef\u53e320\u8fdb\u884c\u6570\u636e\u8fde\u63a5\u3002<br \/>\n#<br \/>\n# If you want, you can arrange for uploaded anonymous files to be owned by<br \/>\n# a different user. Note! Using &#8220;root&#8221; for uploaded files is not<br \/>\n# recommended!<br \/>\n#chown_uploads=YES<br \/>\nchown_uploads=NO<br \/>\n\u8bbe\u5b9a\u7981\u6b62\u4e0a\u4f20\u6587\u4ef6\u66f4\u6539\u5bbf\u4e3b\u3002<br \/>\n#chown_username=whoever<br \/>\n#<br \/>\n# You may override where the log file goes if you like. The default is shown<br \/>\n# below.<br \/>\nxferlog_file=\/var\/log\/vsftpd.log<br \/>\n\u8bbe\u5b9aVsftpd\u7684\u670d\u52a1\u65e5\u5fd7\u4fdd\u5b58\u8def\u5f84\u3002\u6ce8\u610f\uff0c\u8be5\u6587\u4ef6\u9ed8\u8ba4\u4e0d\u5b58\u5728\u3002\u5fc5\u987b\u8981\u624b\u52a8touch\u51fa\u6765\uff0c\u5e76\u4e14\u7531\u4e8e\u8fd9\u91cc\u66f4\u6539\u4e86Vsftpd\u7684\u670d\u52a1\u5bbf\u4e3b\u7528\u6237\u4e3a\u624b\u52a8\u5efa\u7acb\u7684Vsftpd\u3002\u5fc5\u987b\u6ce8\u610f\u7ed9\u4e0e\u8be5\u7528\u6237\u5bf9\u65e5\u5fd7\u7684\u5199\u5165\u6743\u9650\uff0c\u5426\u5219\u670d\u52a1\u5c06\u542f\u52a8\u5931\u8d25\u3002<br \/>\n#<br \/>\n# If you want, you can have your log file in standard ftpd xferlog format<br \/>\nxferlog_std_format=YES<br \/>\n\u8bbe\u5b9a\u65e5\u5fd7\u4f7f\u7528\u6807\u51c6\u7684\u8bb0\u5f55\u683c\u5f0f\u3002<br \/>\n#<br \/>\n# You may change the default value for timing out an idle session.<br \/>\n#idle_session_timeout=600<br \/>\n\u8bbe\u5b9a\u7a7a\u95f2\u8fde\u63a5\u8d85\u65f6\u65f6\u95f4\uff0c\u8fd9\u91cc\u4f7f\u7528\u9ed8\u8ba4\u3002\u5c06\u5177\u4f53\u6570\u503c\u7559\u7ed9\u6bcf\u4e2a\u5177\u4f53\u7528\u6237\u5177\u4f53\u6307\u5b9a\uff0c\u5f53\u7136\u5982\u679c\u4e0d\u6307\u5b9a\u7684\u8bdd\uff0c\u8fd8\u662f\u4f7f\u7528\u8fd9\u91cc\u7684\u9ed8\u8ba4\u503c600\uff0c\u5355\u4f4d\u79d2\u3002<br \/>\n#<br \/>\n# You may change the default value for timing out a data connection.<br \/>\n#data_connection_timeout=120<br \/>\n\u8bbe\u5b9a\u5355\u6b21\u6700\u5927\u8fde\u7eed\u4f20\u8f93\u65f6\u95f4\uff0c\u8fd9\u91cc\u4f7f\u7528\u9ed8\u8ba4\u3002\u5c06\u5177\u4f53\u6570\u503c\u7559\u7ed9\u6bcf\u4e2a\u5177\u4f53\u7528\u6237\u5177\u4f53\u6307\u5b9a\uff0c\u5f53\u7136\u5982\u679c\u4e0d\u6307\u5b9a\u7684\u8bdd\uff0c\u8fd8\u662f\u4f7f\u7528\u8fd9\u91cc\u7684\u9ed8\u8ba4\u503c120\uff0c\u5355\u4f4d\u79d2\u3002<br \/>\n#<br \/>\n# It is recommended that you define on your system a unique user which the<br \/>\n# ftp server can use as a totally isolated and unprivileged user.<br \/>\n#nopriv_user=ftpsecure<br \/>\nnopriv_user=vsftpd<br \/>\n\u8bbe\u5b9a\u652f\u6491Vsftpd\u670d\u52a1\u7684\u5bbf\u4e3b\u7528\u6237\u4e3a\u624b\u52a8\u5efa\u7acb\u7684Vsftpd\u7528\u6237\u3002\u6ce8\u610f\uff0c\u4e00\u65e6\u505a\u51fa\u66f4\u6539\u5bbf\u4e3b\u7528\u6237\u540e\uff0c\u5fc5\u987b\u6ce8\u610f\u4e00\u8d77\u4e0e\u8be5\u670d\u52a1\u76f8\u5173\u7684\u8bfb\u5199\u6587\u4ef6\u7684\u8bfb\u5199\u8d4b\u6743\u95ee\u9898\u3002\u6bd4\u5982\u65e5\u5fd7\u6587\u4ef6\u5c31\u5fc5\u987b\u7ed9\u4e0e\u8be5\u7528\u6237\u5199\u5165\u6743\u9650\u7b49\u3002<br \/>\n#<br \/>\n# Enable this and the server will recognise asynchronous ABOR requests. Not<br \/>\n# recommended for security (the code is non-trivial). Not enabling it,<br \/>\n# however, may confuse older FTP clients.<br \/>\nasync_abor_enable=YES<br \/>\n\u8bbe\u5b9a\u652f\u6301\u5f02\u6b65\u4f20\u8f93\u529f\u80fd\u3002<br \/>\n#<br \/>\n# By default the server will pretend to allow ASCII mode but in fact ignore<br \/>\n# the request. Turn on the below options to have the server actually do ASCII<br \/>\n# mangling on files when in ASCII mode.<br \/>\n# Beware that on some FTP servers, ASCII support allows a denial of service<br \/>\n# attack (DoS) via the command &#8220;SIZE \/big\/file&#8221; in ASCII mode. vsftpd<br \/>\n# predicted this attack and has always been safe, reporting the size of the<br \/>\n# raw file.<br \/>\n# ASCII mangling is a horrible feature of the protocol.<br \/>\nascii_upload_enable=YES<br \/>\nascii_download_enable=YES<br \/>\n\u8bbe\u5b9a\u652f\u6301ASCII\u6a21\u5f0f\u7684\u4e0a\u4f20\u548c\u4e0b\u8f7d\u529f\u80fd\u3002<br \/>\n#<br \/>\n# You may fully customise the login banner string:<br \/>\nftpd_banner=This Vsftp server supports virtual users ^_^<br \/>\n\u8bbe\u5b9aVsftpd\u7684\u767b\u9646\u6807\u8bed\u3002<br \/>\n#<br \/>\n# You may specify a file of disallowed anonymous e-mail addresses. Apparently<br \/>\n# useful for combatting certain DoS attacks.<br \/>\n#deny_email_enable=YES<br \/>\n# (default follows)<br \/>\n#banned_email_file=\/etc\/vsftpd\/banned_emails<br \/>\n#<br \/>\n# You may specify an explicit list of local users to chroot() to their home<br \/>\n# directory. If chroot_local_user is YES, then this list becomes a list of<br \/>\n# users to NOT chroot().<br \/>\n#chroot_list_enable=YES<br \/>\nchroot_list_enable=NO<br \/>\n\u7981\u6b62\u7528\u6237\u767b\u51fa\u81ea\u5df1\u7684FTP\u4e3b\u76ee\u5f55\u3002<br \/>\n# (default follows)<br \/>\n#chroot_list_file=\/etc\/vsftpd\/chroot_list<br \/>\n#<br \/>\n# You may activate the &#8220;-R&#8221; option to the builtin ls. This is disabled by<br \/>\n# default to avoid remote users being able to cause excessive I\/O on large<br \/>\n# sites. However, some broken FTP clients such as &#8220;ncftp&#8221; and &#8220;mirror&#8221; assume<br \/>\n# the presence of the &#8220;-R&#8221; option, so there is a strong case for enabling it.<br \/>\n#ls_recurse_enable=YES<br \/>\nls_recurse_enable=NO<br \/>\n\u7981\u6b62\u7528\u6237\u767b\u9646FTP\u540e\u4f7f\u7528&#8221;ls -R&#8221;\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u4f1a\u5bf9\u670d\u52a1\u5668\u6027\u80fd\u9020\u6210\u5de8\u5927\u5f00\u9500\u3002\u5982\u679c\u8be5\u9879\u88ab\u5141\u8bb8\uff0c\u90a3\u4e48\u6321\u591a\u7528\u6237\u540c\u65f6\u4f7f\u7528\u8be5\u547d\u4ee4\u65f6\u5c06\u4f1a\u5bf9\u8be5\u670d<br \/>\n\u52a1\u5668\u9020\u6210\u5a01\u80c1\u3002<br \/>\n# When &#8220;listen&#8221; directive is enabled, vsftpd runs in standalone mode and<br \/>\n# listens on IPv4 sockets. This directive cannot be used in conjunction<br \/>\n# with the listen_ipv6 directive.<br \/>\nlisten=YES<br \/>\n\u8bbe\u5b9a\u8be5Vsftpd\u670d\u52a1\u5de5\u4f5c\u5728StandAlone\u6a21\u5f0f\u4e0b\u3002\u987a\u4fbf\u5c55\u5f00\u8bf4\u660e\u4e00\u4e0b\uff0c\u6240\u8c13StandAlone\u6a21\u5f0f\u5c31\u662f\u8be5\u670d\u52a1\u62e5\u6709\u81ea\u5df1\u7684\u5b88\u62a4\u8fdb\u7a0b\u652f\u6301\uff0c\u5728ps -A\u547d\u4ee4\u4e0b\u6211\u4eec\u5c06\u53ef\u7528\u770b\u5230vsftpd\u7684\u5b88\u62a4\u8fdb\u7a0b\u540d\u3002\u5982\u679c\u4e0d\u60f3\u5de5\u4f5c\u5728StandAlone\u6a21\u5f0f\u4e0b\uff0c\u5219\u53ef\u4ee5\u9009\u62e9SuperDaemon\u6a21\u5f0f\uff0c\u5728\u8be5\u6a21\u5f0f\u4e0bvsftpd\u5c06\u6ca1\u6709\u81ea\u5df1\u7684\u5b88\u62a4\u8fdb\u7a0b\uff0c\u800c\u662f\u7531\u8d85\u7ea7\u5b88\u62a4\u8fdb\u7a0bXinetd\u5168\u6743\u4ee3\u7406\uff0c\u4e0e\u6b64\u540c\u65f6\uff0cVsftp\u670d\u52a1\u7684\u8bb8\u591a\u529f\u80fd\u5c06\u5f97\u4e0d\u5230\u5b9e\u73b0\u3002<br \/>\n#<br \/>\n# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6<br \/>\n# sockets, you must run two copies of vsftpd whith two configuration files.<br \/>\n# Make sure, that one of the listen options is commented !!<br \/>\n#listen_ipv6=YES<br \/>\npam_service_name=vsftpd<br \/>\n\u8bbe\u5b9aPAM\u670d\u52a1\u4e0bVsftpd\u7684\u9a8c\u8bc1\u914d\u7f6e\u6587\u4ef6\u540d\u3002\u56e0\u6b64\uff0cPAM\u9a8c\u8bc1\u5c06\u53c2\u8003\/etc\/pam.d\/\u4e0b\u7684vsftpd\u6587\u4ef6\u914d\u7f6e\u3002<br \/>\nuserlist_enable=YES<br \/>\n\u8bbe\u5b9auserlist_file\u4e2d\u7684\u7528\u6237\u5c06\u4e0d\u5f97\u4f7f\u7528FTP\u3002<br \/>\ntcp_wrappers=YES<br \/>\n\u8bbe\u5b9a\u652f\u6301TCP Wrappers\u3002<\/p>\n<p>#KC: The following entries are added for supporting virtual ftp users.<br \/>\n\u4ee5\u4e0b\u8fd9\u4e9b\u662f\u5173\u4e8eVsftpd\u865a\u62df\u7528\u6237\u652f\u6301\u7684\u91cd\u8981\u914d\u7f6e\u9879\u76ee\u3002\u9ed8\u8ba4Vsftpd.conf\u4e2d\u4e0d\u5305\u542b\u8fd9\u4e9b\u8bbe\u5b9a\u9879\u76ee\uff0c\u9700\u8981\u81ea\u5df1\u624b\u52a8\u6dfb\u52a0\u914d\u7f6e\u3002<br \/>\nguest_enable=YES<br \/>\n\u8bbe\u5b9a\u542f\u7528\u865a\u62df\u7528\u6237\u529f\u80fd\u3002<br \/>\nguest_username=overlord<br \/>\n\u6307\u5b9a\u865a\u62df\u7528\u6237\u7684\u5bbf\u4e3b\u7528\u6237\u3002<br \/>\nvirtual_use_local_privs=YES<br \/>\n\u8bbe\u5b9a\u865a\u62df\u7528\u6237\u7684\u6743\u9650\u7b26\u5408\u4ed6\u4eec\u7684\u5bbf\u4e3b\u7528\u6237\u3002<br \/>\nuser_config_dir=\/etc\/vsftpd\/vconf<br \/>\n\u8bbe\u5b9a\u865a\u62df\u7528\u6237\u4e2a\u4ebaVsftp\u7684\u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u8def\u5f84\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u8fd9\u4e2a\u88ab\u6307\u5b9a\u7684\u76ee\u5f55\u91cc\uff0c\u5c06\u5b58\u653e\u6bcf\u4e2aVsftp\u865a\u62df\u7528\u6237\u4e2a\u6027\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4e00\u4e2a\u9700\u8981\u6ce8\u610f\u7684<br \/>\n\u5730\u65b9\u5c31\u662f\u8fd9\u4e9b\u914d\u7f6e\u6587\u4ef6\u540d\u5fc5\u987b\u548c\u865a\u62df\u7528\u6237\u540d\u76f8\u540c\u3002<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n\u4fdd\u5b58\u9000\u51fa\u3002<\/p>\n<p>3.\u5efa\u7acbVsftpd\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u5e76\u66f4\u8be5\u5c5e\u4e3b\u4e3aVsftpd\u7684\u670d\u52a1\u5bbf\u4e3b\u7528\u6237\uff1a<br \/>\n[root@KcentOS5 ~]# touch \/var\/log\/vsftpd.log<br \/>\n[root@KcentOS5 ~]# chown vsftpd.vsftpd \/var\/log\/vsftpd.log<\/p>\n<p>4.\u5efa\u7acb\u865a\u62df\u7528\u6237\u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u8def\u5f84\uff1a<br \/>\n[root@KcentOS5 ~]# mkdir \/etc\/vsftpd\/vconf\/<\/p>\n<p>\u4e09.\u5236\u4f5c\u865a\u62df\u7528\u6237\u6570\u636e\u5e93\u6587\u4ef6<br \/>\n1.\u5148\u5efa\u7acb\u865a\u62df\u7528\u6237\u540d\u5355\u6587\u4ef6\uff1a<br \/>\n[root@KcentOS5 ~]# touch \/etc\/vsftpd\/virtusers<br \/>\n\u5efa\u7acb\u4e86\u4e00\u4e2a\u865a\u62df\u7528\u6237\u540d\u5355\u6587\u4ef6\uff0c\u8fd9\u4e2a\u6587\u4ef6\u5c31\u662f\u6765\u8bb0\u5f55vsftpd\u865a\u62df\u7528\u6237\u7684\u7528\u6237\u540d\u548c\u53e3\u4ee4\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6211\u8fd9\u91cc\u7ed9\u5b83\u547d\u540d\u4e3avirtusers\u3002\u4e3a\u4e86\u907f\u514d\u6587\u4ef6\u7684\u6df7\u4e71\uff0c\u6211\u628a\u8fd9\u4e2a\u540d\u5355\u6587\u4ef6\u5c31\u653e\u7f6e\u5728\/etc\/vsftpd\/\u4e0b\u3002<\/p>\n<p>2.\u7f16\u8f91\u865a\u62df\u7528\u6237\u540d\u5355\u6587\u4ef6\uff1a<br \/>\n[root@KcentOS5 ~]# vi \/etc\/vsftpd\/virtusers<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nkanecruise<br \/>\n123456<br \/>\nnear<br \/>\n123456near<br \/>\nmello<br \/>\n123456mello<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n\u7f16\u8f91\u8fd9\u4e2a\u865a\u62df\u7528\u6237\u540d\u5355\u6587\u4ef6\uff0c\u5728\u5176\u4e2d\u52a0\u5165\u7528\u6237\u7684\u7528\u6237\u540d\u548c\u53e3\u4ee4\u4fe1\u606f\u3002\u683c\u5f0f\u5f88\u7b80\u5355\uff1a\u201c\u4e00\u884c\u7528\u6237\u540d\uff0c\u4e00\u884c\u53e3\u4ee4\u201d\u3002<\/p>\n<p>3.\u751f\u6210\u865a\u62df\u7528\u6237\u6570\u636e\u6587\u4ef6\uff1a<br \/>\n[root@KcentOS5 ~]# db_load -T -t hash -f \/etc\/vsftpd\/virtusers \/etc\/vsftpd\/virtusers.db<br \/>\n\u8fd9\u91cc\u6211\u987a\u4fbf\u628a\u8fd9\u4e2a\u547d\u4ee4\u7b80\u5355\u8bf4\u660e\u4e00\u4e0b<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n\u5bdf\u770bdb4\u7684db_load\u547d\u4ee4\u4f7f\u7528\u65b9\u6cd5\uff1a<br \/>\n[root@KSRV2 vsftpd]# db_load<br \/>\nusage: db_load [-nTV] [-c name=value] [-f file]<br \/>\n        [-h home] [-P password] [-t btree | hash | recno | queue] db_file<br \/>\nusage: db_load -r lsn | fileid [-h home] [-P password] db_file<br \/>\n\u89e3\u91ca\u5728\u672c\u7bc7\u4e2d\uff0cdb_load\u547d\u4ee4\u51e0\u4e2a\u76f8\u5173\u9009\u9879\u5f88\u53c2\u6570<br \/>\n-T<br \/>\nThe -T option allows non-Berkeley DB applications to easily load text files into databases.<br \/>\nIf the database to be created is of type Btree or Hash, or the keyword keys is specified as set, the input must be paired<br \/>\nlines of text, where the first line of the pair is the key item, and the second line of the pair is its corresponding data<br \/>\nitem. If the database to be created is of type Queue or Recno and the keywork keys is not set, the input must be lines of text, where each line is a new data item for the database.<br \/>\n\u9009\u9879-T\u5141\u8bb8\u5e94\u7528\u7a0b\u5e8f\u80fd\u591f\u5c06\u6587\u672c\u6587\u4ef6\u8f6c\u8bd1\u8f7d\u5165\u8fdb\u6570\u636e\u5e93\u3002\u7531\u4e8e\u6211\u4eec\u4e4b\u540e\u662f\u5c06\u865a\u62df\u7528\u6237\u7684\u4fe1\u606f\u4ee5\u6587\u4ef6\u65b9\u5f0f\u5b58\u50a8\u5728\u6587\u4ef6\u91cc\u7684\uff0c\u4e3a\u4e86\u8ba9Vsftpd\u8fd9\u4e2a<br \/>\n\u5e94\u7528\u7a0b\u5e8f\u80fd\u591f\u901a\u8fc7\u6587\u672c\u6765\u8f7d\u5165\u7528\u6237\u6570\u636e\uff0c\u5fc5\u987b\u8981\u4f7f\u7528\u8fd9\u4e2a\u9009\u9879\u3002<br \/>\nIf the -T option is specified, the underlying access method type must be specified using the -t option.<br \/>\n\u5982\u679c\u6307\u5b9a\u4e86\u9009\u9879-T\uff0c\u90a3\u4e48\u4e00\u5b9a\u8981\u8ffd\u8ddf\u5b50\u9009\u9879-t<\/p>\n<p>-t<br \/>\nSpecify the underlying access method. If no -t option is specified, the database will be loaded into a database of the same type as was dumped; for example, a Hash database will be created if a Hash database was dumped.<br \/>\nBtree and Hash databases may be converted from one to the other. Queue and Recno databases may be converted from one to the other. If the -k option was specified on the call to db_dump then Queue and Recno databases may be converted to Btree or Hash, with the key being the integer record number.<br \/>\n\u5b50\u9009\u9879-t\uff0c\u8ffd\u52a0\u5728\u5728-T\u9009\u9879\u540e\uff0c\u7528\u6765\u6307\u5b9a\u8f6c\u8bd1\u8f7d\u5165\u7684\u6570\u636e\u5e93\u7c7b\u578b\u3002\u6269\u5c55\u4ecb\u7ecd\u4e0b\uff0c-t\u53ef\u4ee5\u6307\u5b9a\u7684\u6570\u636e\u7c7b\u578b\u6709Btree\u3001Hash\u3001Queue\u548cRecon\u6570\u636e\u5e93\u3002\u8fd9\u91cc\uff0c\u63a5\u4e0b\u6765\u6211\u4eec\u9700\u8981\u6307\u5b9a\u7684\u662fHash\u578b\u3002<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>4.\u5bdf\u770b\u751f\u6210\u7684\u865a\u62df\u7528\u6237\u6570\u636e\u6587\u4ef6<br \/>\n[root@KcentOS5 ~]# ll \/etc\/vsftpd\/virtusers.db<br \/>\n-rw-r&#8211;r&#8211; 1 root root 12288 Sep 16 03:51 \/etc\/vsftpd\/virtusers.db<br \/>\n    \u9700\u8981\u7279\u522b\u6ce8\u610f\u7684\u662f\uff0c\u4ee5\u540e\u518d\u8981\u6dfb\u52a0\u865a\u62df\u7528\u6237\u7684\u65f6\u5019\uff0c\u53ea\u9700\u8981\u6309\u7167\u201c\u4e00\u884c\u7528\u6237\u540d\uff0c\u4e00\u884c\u53e3\u4ee4\u201d\u7684\u683c\u5f0f\u5c06\u65b0\u7528\u6237\u540d\u548c\u53e3\u4ee4\u6dfb\u52a0\u8fdb\u865a\u62df\u7528\u6237\u540d\u5355\u6587\u4ef6\u3002\u4f46\u662f\u5149\u8fd9\u6837\u505a\u8fd8\u4e0d\u591f\uff0c\u4e0d\u4f1a\u751f\u6548\u7684\u54e6\uff01\u8fd8\u8981\u518d\u6267\u884c\u4e00\u904d\u201c db_load -T -t hash -f \u865a\u62df\u7528\u6237\u540d\u5355\u6587\u4ef6 \u865a\u62df\u7528\u6237\u6570\u636e\u5e93\u6587\u4ef6.db \u201d\u7684\u547d\u4ee4\u4f7f<br \/>\n\u5176\u751f\u6548\u624d\u53ef\u4ee5\uff01<\/p>\n<p>\u56db.\u8bbe\u5b9aPAM\u9a8c\u8bc1\u6587\u4ef6\uff0c\u5e76\u6307\u5b9a\u865a\u62df\u7528\u6237\u6570\u636e\u5e93\u6587\u4ef6\u8fdb\u884c\u8bfb\u53d6<br \/>\n1.\u5bdf\u770b\u539f\u6765\u7684Vsftp\u7684PAM\u9a8c\u8bc1\u914d\u7f6e\u6587\u4ef6\uff1a<br \/>\n[root@KcentOS5 ~]# cat \/etc\/pam.d\/vsftpd<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n#%PAM-1.0<br \/>\nsession    optional     pam_keyinit.so    force revoke<br \/>\nauth       required     pam_listfile.so item=user sense=deny file=\/etc\/vsftpd\/ftpusers onerr=succeed<br \/>\nauth       required     pam_shells.so<br \/>\nauth       include      system-auth<br \/>\naccount    include      system-auth<br \/>\nsession    include      system-auth<br \/>\nsession    required     pam_loginuid.so<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>2.\u5728\u7f16\u8f91\u524d\u505a\u597d\u5907\u4efd\uff1a<br \/>\n[root@KcentOS5 ~]# mv \/etc\/pam.d\/vsftpd \/etc\/pam.d\/vsftpd.backup   <\/p>\n<p>3.\u7f16\u8f91Vsftpd\u7684PAM\u9a8c\u8bc1\u914d\u7f6e\u6587\u4ef6<br \/>\n[root@KcentOS5 ~]# vim  \/etc\/pam.d\/vsftpd<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n#%PAM-1.0<br \/>\nauth    sufficient      \/lib\/security\/pam_userdb.so     db=\/etc\/vsftpd\/virtusers<br \/>\naccount sufficient      \/lib\/security\/pam_userdb.so     db=\/etc\/vsftpd\/virtusers<br \/>\n\u4ee5\u4e0a\u4e24\u6761\u662f\u624b\u52a8\u6dfb\u52a0\u7684\uff0c\u5185\u5bb9\u662f\u5bf9\u865a\u62df\u7528\u6237\u7684\u5b89\u5168\u548c\u5e10\u6237\u6743\u9650\u8fdb\u884c\u9a8c\u8bc1\u3002<br \/>\n\u8fd9\u91cc\u7684auth\u662f\u6307\u5bf9\u7528\u6237\u7684\u7528\u6237\u540d\u53e3\u4ee4\u8fdb\u884c\u9a8c\u8bc1\u3002<br \/>\n\u8fd9\u91cc\u7684accout\u662f\u6307\u5bf9\u7528\u6237\u7684\u5e10\u6237\u6709\u54ea\u4e9b\u6743\u9650\u54ea\u4e9b\u9650\u5236\u8fdb\u884c\u9a8c\u8bc1\u3002<br \/>\n\u5176\u540e\u7684sufficient\u8868\u793a\u5145\u5206\u6761\u4ef6\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u4e00\u65e6\u5728\u8fd9\u91cc\u901a\u8fc7\u4e86\u9a8c\u8bc1\uff0c\u90a3\u4e48\u4e5f\u5c31\u4e0d\u7528\u7ecf\u8fc7\u4e0b\u9762\u5269\u4e0b\u7684\u9a8c\u8bc1\u6b65\u9aa4\u4e86\u3002\u76f8\u53cd\uff0c\u5982\u679c\u6ca1\u6709\u901a\u8fc7\u7684\u8bdd\uff0c\u4e5f\u4e0d\u4f1a\u88ab\u7cfb\u7edf\u7acb\u5373\u6321\u4e4b\u95e8\u5916\uff0c\u56e0\u4e3asufficient\u7684\u5931\u8d25\u4e0d\u51b3\u5b9a\u6574\u4e2a\u9a8c\u8bc1\u7684\u5931\u8d25\uff0c\u610f\u5473\u7740\u7528\u6237\u8fd8\u5fc5\u987b\u5c06\u7ecf\u5386\u5269\u4e0b\u6765\u7684\u9a8c\u8bc1\u5ba1\u6838\u3002<br \/>\n\u518d\u540e\u9762\u7684\/lib\/security\/pam_userdb.so\u8868\u793a\u8be5\u6761\u5ba1\u6838\u5c06\u8c03\u7528pam_userdb.so\u8fd9\u4e2a\u5e93\u51fd\u6570\u8fdb\u884c\u3002<br \/>\n\u6700\u540e\u7684db=\/etc\/vsftpd\/virtusers\u5219\u6307\u5b9a\u4e86\u9a8c\u8bc1\u5e93\u51fd\u6570\u5c06\u5230\u8fd9\u4e2a\u6307\u5b9a\u7684\u6570\u636e\u5e93\u4e2d\u8c03\u7528\u6570\u636e\u8fdb\u884c\u9a8c\u8bc1\u3002<br \/>\n#KC: The entries for Vsftpd-PAM are added above.<br \/>\nsession    optional     pam_keyinit.so    force revoke<br \/>\nauth       required     pam_listfile.so item=user sense=deny file=\/etc\/vsftpd\/ftpusers onerr=succeed<br \/>\nauth       required     pam_shells.so<br \/>\nauth       include      system-auth<br \/>\naccount    include      system-auth<br \/>\nsession    include      system-auth<br \/>\nsession    required     pam_loginuid.so<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>\u4e94.\u865a\u62df\u7528\u6237\u7684\u914d\u7f6e<br \/>\n1.\u89c4\u5212\u597d\u865a\u62df\u7528\u6237\u7684\u4e3b\u8def\u5f84\uff1a<br \/>\n[root@KcentOS5 ~]# mkdir \/opt\/vsftp\/<\/p>\n<p>2.\u5efa\u7acb\u6d4b\u8bd5\u7528\u6237\u7684FTP\u7528\u6237\u76ee\u5f55\uff1a<br \/>\n[root@KcentOS5 ~]# mkdir \/opt\/vsftp\/kanecruise\/ \/opt\/vsftp\/mello\/ \/opt\/vsftp\/near\/<\/p>\n<p>3.\u5efa\u7acb\u865a\u62df\u7528\u6237\u914d\u7f6e\u6587\u4ef6\u6a21\u7248\uff1a<br \/>\n[root@KcentOS5 ~]# cp \/etc\/vsftpd\/vsftpd.conf.backup \/etc\/vsftpd\/vconf\/vconf.tmp<\/p>\n<p>4.\u5b9a\u5236\u865a\u62df\u7528\u6237\u6a21\u7248\u914d\u7f6e\u6587\u4ef6\uff1a<br \/>\n[root@KcentOS5 ~]# vi \/etc\/vsftpd\/vconf\/vconf.tmp<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nlocal_root=\/opt\/vsftp\/virtuser<br \/>\n\u6307\u5b9a\u865a\u62df\u7528\u6237\u7684\u5177\u4f53\u4e3b\u8def\u5f84\u3002<br \/>\nanonymous_enable=NO<br \/>\n\u8bbe\u5b9a\u4e0d\u5141\u8bb8\u533f\u540d\u7528\u6237\u8bbf\u95ee\u3002<br \/>\nwrite_enable=YES<br \/>\n\u8bbe\u5b9a\u5141\u8bb8\u5199\u64cd\u4f5c\u3002<br \/>\nlocal_umask=022<br \/>\n\u8bbe\u5b9a\u4e0a\u4f20\u6587\u4ef6\u6743\u9650\u63a9\u7801\u3002<br \/>\nanon_upload_enable=NO<br \/>\n\u8bbe\u5b9a\u4e0d\u5141\u8bb8\u533f\u540d\u7528\u6237\u4e0a\u4f20\u3002<br \/>\nanon_mkdir_write_enable=NO<br \/>\n\u8bbe\u5b9a\u4e0d\u5141\u8bb8\u533f\u540d\u7528\u6237\u5efa\u7acb\u76ee\u5f55\u3002<br \/>\nidle_session_timeout=600<br \/>\n\u8bbe\u5b9a\u7a7a\u95f2\u8fde\u63a5\u8d85\u65f6\u65f6\u95f4\u3002<br \/>\ndata_connection_timeout=120<br \/>\n\u8bbe\u5b9a\u5355\u6b21\u8fde\u7eed\u4f20\u8f93\u6700\u5927\u65f6\u95f4\u3002<br \/>\nmax_clients=10<br \/>\n\u8bbe\u5b9a\u5e76\u53d1\u5ba2\u6237\u7aef\u8bbf\u95ee\u4e2a\u6570\u3002<br \/>\nmax_per_ip=5<br \/>\n\u8bbe\u5b9a\u5355\u4e2a\u5ba2\u6237\u7aef\u7684\u6700\u5927\u7ebf\u7a0b\u6570\uff0c\u8fd9\u4e2a\u914d\u7f6e\u4e3b\u8981\u6765\u7167\u987eFlashget\u3001\u8fc5\u96f7\u7b49\u591a\u7ebf\u7a0b\u4e0b\u8f7d\u8f6f\u4ef6\u3002<br \/>\nlocal_max_rate=50000<br \/>\n\u8bbe\u5b9a\u8be5\u7528\u6237\u7684\u6700\u5927\u4f20\u8f93\u901f\u7387\uff0c\u5355\u4f4db\/s\u3002<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n\u8fd9\u91cc\u5c06\u539fvsftpd.conf\u914d\u7f6e\u6587\u4ef6\u7ecf\u8fc7\u7b80\u5316\u540e\u4fdd\u5b58\u4f5c\u4e3a\u865a\u62df\u7528\u6237\u914d\u7f6e\u6587\u4ef6\u7684\u6a21\u7248\u3002\u8fd9\u91cc\u5c06\u5e76\u4e0d\u9700\u8981\u6307\u5b9a\u592a\u591a\u7684\u914d\u7f6e\u5185\u5bb9\uff0c\u4e3b\u8981\u7684\u6846\u67b6\u548c\u9650\u5236\u4ea4\u7531Vsftpd\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6vsftpd.conf\u6765\u5b9a\u4e49\uff0c\u5373\u865a\u62df\u7528\u6237\u914d\u7f6e\u6587\u4ef6\u5f53\u4e2d\u6ca1\u6709\u63d0\u5230\u7684\u914d\u7f6e\u9879\u76ee\u5c06\u53c2\u8003\u4e3b\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u8bbe\u5b9a\u3002\u800c\u5728\u8fd9\u91cc\u4f5c\u4e3a\u865a\u62df\u7528\u6237\u7684\u914d\u7f6e\u6587\u4ef6\u6a21\u7248\u53ea\u9700\u8981\u7559\u4e00\u4e9b\u548c\u7528\u6237\u6d41\u91cf\u63a7\u5236\uff0c\u8bbf\u95ee\u65b9\u5f0f\u63a7\u5236\u7684\u914d\u7f6e\u9879\u76ee\u5c31\u53ef\u4ee5\u4e86\u3002\u8fd9\u91cc\u7684\u5173\u952e\u9879\u662flocal_root\u8fd9\u4e2a\u914d\u7f6e\uff0c\u7528\u6765\u6307\u5b9a\u8fd9\u4e2a\u865a\u62df\u7528\u6237\u7684FTP\u4e3b\u8def\u5f84\u3002<\/p>\n<p>5.\u66f4\u6539\u865a\u62df\u7528\u6237\u7684\u4e3b\u76ee\u5f55\u7684\u5c5e\u4e3b\u4e3a\u865a\u62df\u5bbf\u4e3b\u7528\u6237\uff1a<br \/>\n[root@KcentOS5 ~]# chown -R overlord.overlord \/opt\/vsftp\/<\/p>\n<p>6.\u68c0\u67e5\u6743\u9650\uff1a<br \/>\n[root@KcentOS5 ~]# ll \/opt\/vsftp\/<br \/>\ntotal 24<br \/>\ndrwxr-xr-x 2 overlord overlord 4096 Sep 16 05:14 kanecruise<br \/>\ndrwxr-xr-x 2 overlord overlord 4096 Sep 16 05:00 mello<br \/>\ndrwxr-xr-x 2 overlord overlord 4096 Sep 16 05:00 near<\/p>\n<p>\u516d.\u7ed9\u6d4b\u8bd5\u7528\u6237\u5b9a\u5236\uff1a<br \/>\n1.\u4ece\u865a\u62df\u7528\u6237\u6a21\u7248\u914d\u7f6e\u6587\u4ef6\u590d\u5236\uff1a<br \/>\n[root@KcentOS5 ~]# cp \/etc\/vsftpd\/vconf\/vconf.tmp \/etc\/vsftpd\/vconf\/kanecruise<\/p>\n<p>2.\u9488\u5bf9\u5177\u4f53\u7528\u6237\u8fdb\u884c\u5b9a\u5236\uff1a<br \/>\n[root@KcentOS5 ~]# vi \/etc\/vsftpd\/vconf\/kanecruise<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nlocal_root=\/opt\/vsftp\/kanecruise<br \/>\nanonymous_enable=NO<br \/>\nwrite_enable=YES<br \/>\nlocal_umask=022<br \/>\nanon_upload_enable=NO<br \/>\nanon_mkdir_write_enable=NO<br \/>\nidle_session_timeout=300<br \/>\ndata_connection_timeout=90<br \/>\nmax_clients=1<br \/>\nmax_per_ip=1<br \/>\nlocal_max_rate=25000<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>\u4e03.\u542f\u52a8\u670d\u52a1\uff1a<br \/>\n[root@KcentOS5 ~]# service vsftpd start<br \/>\nStarting vsftpd for vsftpd:                                [  OK  ]<\/p>\n<p>\u7279\u522b\u8bf4\u660e\uff1a<\/p>\n<p>\u5982\u679c\u9700\u8981\u9501\u5b9a\u865a\u62df\u7528\u6237\u767b\u9646\u540e\u7684\u76ee\u5f55\u3002<br \/>\n\u9700\u8981\u4fee\u6539vsftpd.conf<br \/>\n\u5c06chroot_list_enable\u7684\u503c\u4fee\u6539\u4e3ayes<br \/>\n\u5e76\u6ce8\u610f\u5728\/etc\/vsftpd\u76ee\u5f55\u4e0b\u6dfb\u52a0chroot_list\u6587\u4ef6\u3002\u5e76\u5c06\u865a\u62df\u7528\u6237\u7684\u540d\u5b57\u5199\u8fdb\u53bb\u3002<br \/>\n\u6bcf\u884c\u4e00\u4e2a<\/p>\n<p>\u53e6\u5916\u8981\u6ce8\u610f\u4e00\u70b9\u3002\u5982\u679c\u6bcf\u6b21\u767b\u9646\u90fd\u65e0\u6cd5\u6b63\u5e38\u8ba4\u8bc1\u51fa\u73b0\u9519\u8bef\u63d0\u793a\uff1a<br \/>\n530 Login incorrect<br \/>\n\u8fd9\u8868\u793a\u65e0\u6cd5\u6b63\u5e38\u8ba4\u8bc1\u7528\u6237\u6587\u4ef6\u3002<br \/>\n\u6ce8\u610f\/etc\/pam.d\/vsftpd \u4e2d\u7684\u8ba4\u8bc1\u6a21\u5757\u662f\u5426\u53ef\u4ee5\u627e\u5230\uff01<br \/>\nauth    sufficient      \/lib\/security\/pam_userdb.so     db=\/etc\/vsftpd\/virtusers<br \/>\n\u5c31\u662f\/lib\/security \u8fd9\u4e2a\u6728\u6709\u662f\u5426\u5b58\u5728\uff0c\u76ee\u5f55\u4e0b\u662f\u5426\u6709pam_userdb.so\u8fd9\u4e2a\u6587\u4ef6\u3002<br \/>\n\u5982\u679c\u6ca1\u6709\uff0c\u53bb\u627e\u627e\u770b\/lib64\u4e5f\u8bb8\u56e0\u4e3a\u4f60\u662f64\u4f4d\u7cfb\u7edf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00.\u5b89\u88c5\uff1a 1.\u5b89\u88c5Vsftpd\u670d\u52a1\u76f8\u5173\u90e8\u4ef6\uff1a [root@KcentOS5 ~]# yum install &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,8],"tags":[],"class_list":["post-338","post","type-post","status-publish","format-standard","hentry","category-technique","category-master"],"_links":{"self":[{"href":"https:\/\/blogs.woria.cn\/index.php?rest_route=\/wp\/v2\/posts\/338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.woria.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.woria.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.woria.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.woria.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=338"}],"version-history":[{"count":0,"href":"https:\/\/blogs.woria.cn\/index.php?rest_route=\/wp\/v2\/posts\/338\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.woria.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.woria.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.woria.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}