﻿{"id":1123,"date":"2013-12-03T14:17:40","date_gmt":"2013-12-03T06:17:40","guid":{"rendered":"http:\/\/nick.txtcc.com\/?p=1123"},"modified":"2013-12-03T23:41:23","modified_gmt":"2013-12-03T15:41:23","slug":"ubuntu%e4%b8%8b%e4%bd%bf%e7%94%a8pure-ftpd-%e9%80%8f%e9%81%8e-mysql%e7%ae%a1%e7%90%86%e8%99%9b%e6%93%acftp%e7%94%a8%e6%88%b6%e5%b8%b3%e8%99%9f","status":"publish","type":"post","link":"https:\/\/nick.txtcc.com\/index.php\/linux\/1123","title":{"rendered":"Ubuntu\u4e0b\u4f7f\u7528Pure-ftpd \u900f\u904e MySQL\u7ba1\u7406\u865b\u64ecFTP\u7528\u6236\u5e33\u865f"},"content":{"rendered":"<p>\u61c9\u7528\u8da8\u52e2\nPure-ftpd\u662f\u4e00\u500b\u5f88\u65b9\u4fbf\u7ba1\u7406\u7684FTP\u4f3a\u670d\u5668\n\u6211\u5011\u5229\u7528\u5b83\u4f86\u63d0\u4f9b\u57fa\u672c\u7684FTP\u670d\u52d9\u662f\u5f88\u5bb9\u6613\u7684\n\u5728 Ubuntu \u4e0b\u5b83\u6709\u5e7e\u500b\u5b89\u88dd\u985e\u578b\u9078\u64c7\n(\u4ed6\u5011\u9593\u5f7c\u6b64\u4e92\u65a5..\u53ea\u80fd\u88dd\u4e00\u985e)<\/p>\n<p>1.\u539f\u59cb\u800c\u55ae\u7d14\u7684\u7528\u6cd5(\u548c\u7cfb\u7d71\u7684\u5be6\u9ad4\u5e33\u865f\u6709\u95dc)\n\u9019\u7a2e\u7528\u6cd5\u60a8\u53ea\u8981\u5b89\u88dd pure-ftpd \u5c31\u597d\u4e86\nsudo apt-get install pure-ftpd<\/p>\n<p>2.\u914d\u5408 MySQL\u8cc7\u6599\u5eab \u4f5c\u70ba\u8a8d\u8b49\u7684\u7528\u6cd5(\u548c\u7cfb\u7d71\u5be6\u9ad4\u5e33\u865f\u7121\u95dc)\n\u9019\u7a2e\u7528\u6cd5\u60a8\u8981\u5b89\u88dd pure-ftpd-mysql\nsudo apt-get install pure-ftpd-mysql<\/p>\n<p>3.\u914d\u5408 PostgreSQL\u8cc7\u6599\u5eab \u4f5c\u70ba\u8a8d\u8b49\u7684\u7528\u6cd5(\u548c\u7cfb\u7d71\u5be6\u9ad4\u5e33\u865f\u7121\u95dc)\n\u9019\u7a2e\u7528\u6cd5\u60a8\u8981\u5b89\u88dd pure-ftpd-postgresql\nsudo apt-get install pure-ftpd-postgresql<\/p>\n<p>4.\u914d\u5408 LDAP\u8cc7\u6599\u5eab \u4f5c\u70ba\u8a8d\u8b49\u7684\u7528\u6cd5(\u548c\u7cfb\u7d71\u5be6\u9ad4\u5e33\u865f\u7121\u95dc)\n\u9019\u7a2e\u7528\u6cd5\u60a8\u8981\u5b89\u88dd pure-ftpd-ldap\nsudo apt-get install pure-ftpd-ldap<\/p>\n<p>\u5176\u5be6 proftpd \u4e5f\u6709\u985e\u4f3c\u7684\u4f5c\u6cd5..\u5b83\u53ef\u4ee5\u63d0\u4f9b\u7684\u914d\u5408\u985e\u578b\n\u9084\u8981\u591a2\u7a2e\nproftpd-mod-ldap    proftpd-mod-pgsql\nproftpd-mod-mysql   proftpd-mod-sqlite\nproftpd-mod-odbc    <\/p>\n<p>OK \u77ad\u89e3 FTP \u4f3a\u670d\u5668\u7684\u61c9\u7528\u8da8\u52e2\u5f8c\n\u6211\u5011\u518d\u56de\u904e\u795e\u4f86\u5c08\u6ce8\u5728 \u6211\u5011\u4eca\u5929\u7684\u4e3b\u984c\u4e4b\u5167\n\u5229\u7528 pure-ftpd-mysql \u53bb\u5efa\u7acb\u4e00\u500b\u5177\u6709\u865b\u64ec\u5e33\u865f\u7ba1\u7406\u529f\u80fd\u7684FTP\u4f3a\u670d\u5668<\/p>\n<p>\u865b\u64ec\u5e33\u865f<\/p>\n<p>\u5148\u8ac7\u8ac7\u865b\u64ec\u5e33\u865f\uff0c\u70ba\u4f55\u4e0d\u8981\u7528\u771f\u5be6\u5e33\u865f\n\u5728\u4f7f\u7528 Linux \u4e3b\u6a5f\u6642\uff0c\u6709\u4eba\u8981\u50b3\u9001\u6a94\u6848\u5230\u4f3a\u670d\u5668\u4e0a\n\u4e00\u822c\u6211\u5011\u6703\u958b\u7acb\u4e00\u500b\u5be6\u9ad4\u5e33\u865f\uff0c\u8b93\u9019\u500b\u4f7f\u7528\u8005\u4f7f\u7528\n\u800c\u9019\u6a23\u7684\u4f5c\u6cd5\uff0c\u901a\u5e38\u8b93\u9019\u500b\u5e33\u865f\u53ef\u4ee5\u767b\u5165\u5230\u4e3b\u6a5f\u5167\uff0c\n\u800c\u9019\u4e9b\u5e33\u865f\uff0c\u901a\u5e38\u4e5f\u662f\u99ed\u5ba2\u4e0b\u624b\u7684\u76ee\u6a19\u4e4b\u4e00\n(\u4e00\u822c\u7684\u4f7f\u7528\u8005\u6ce8\u91cd\u5b89\u5168\u7684\u7a0b\u5ea6\u901a\u5e38\u9060\u4f4e\u65bc\u7cfb\u7d71\u7ba1\u7406\u54e1)<\/p>\n<p>\u7576\u7136\u7684\uff0c\u4ed6\u4e5f\u80fd\u5728\u4e0a\u9762\u57f7\u884c\u4e00\u4e9b\u7a0b\u5f0f\u6216\u4f5c\u5176\u4ed6\u7684\u4e8b\u3002\n\u4e00\u822cLinux\u4e3b\u6a5f\u662f\u96e3\u4ee5\u88ab\u653b\u64ca\u7684\uff0c\u4f46\u662f\u5982\u679c\u653b\u64ca\u8005\n\u6709\u9019\u6a23\u7684\u6b0a\u9650\uff0c\u53ef\u4ee5\u5408\u6cd5\u7684\u9032\u5230\u4e3b\u6a5f\u5167\u6642\uff0c\u4ed6\u8981\u53d6\u5f97\n\u6700\u9ad8\u7ba1\u7406\u54e1\u7684\u6b0a\u9650\u53ea\u662f\u6642\u9593\u7684\u554f\u984c\u4e86\u3002\n\u6240\u4ee5\u4e00\u822c\u7684\u7ba1\u7406\u54e1\u4e0d\u8f15\u6613\u7684\u5c07\u5be6\u9ad4\u5e33\u865f\u958b\u8a2d\u51fa\u53bb\u3002\n\u56e0\u6b64\u5efa\u7acb\u4e00\u500b\u53ea\u8b93\u865b\u64ec\u5e33\u865f\u53ef\u4ee5\u4e0a\u50b3\u4e0b\u8f09\u7684 FTP \u4f3a\u670d\u5668\n\u8b8a\u7684\u66f4\u80fd\u7b26\u5408\u8cc7\u8a0a\u5b89\u5168\u7684\u9808\u6c42\u3002<\/p>\n<p>OK\uff01\u77ad\u89e3\u4e86\u9019\u4e9b\u80cc\u666f\uff0c\u6211\u5011\u5c31\u5411\u5be6\u4f5c\u7684\u968e\u6bb5\u51fa\u767c\u5427\uff01<\/p>\n<p>\u5be6\u4f5c\u904e\u7a0b<\/p>\n<p>\u4e00\u3001\u57fa\u672c\u8a2d\u5b9a<\/p>\n<p>1.Ubuntu \u4e0b\u5b89\u88dd pure-ftpd-mysql\n\u6253\u958b\u7d42\u7aef\u6a5f\u6216\u9023\u7dda\u5230\u60a8\u7684 Ubuntu \u4e3b\u6a5f\n\u8f38\u5165\u4e0b\u5217\u6307\u4ee4\nsudo apt-get install pure-ftpd-mysql\n\u5b83\u5c31\u6703\u5c07\u5fc5\u8981\u7684\u76f8\u95dc\u5957\u4ef6\u4e00\u4f75\u88dd\u4e0a<\/p>\n<p>2.\u8a2d\u5b9a\u5b89\u5168\u6027\nPS:\u63a5\u4e0b\u7684\u64cd\u4f5c\u60a8\u53ea\u8981\u8907\u88fd\u82f1\u6587\u6307\u4ee4\u5230\u7d42\u7aef\u6a5f\u5167\u57f7\u884c\u5373\u53ef\nsudo -i\n\u5148\u8b8a\u70ba root <\/p>\n<p>echo &#8220;yes&#8221; > \/etc\/pure-ftpd\/conf\/ChrootEveryone\n\u610f\u601d\u662f\u5efa\u7acb\u4e00\u500bChrootEveryone\u7684\u6a94\u6848\u5167\u5bb9\u70bayes\n\u5c31\u662f\u9650\u5236 FTP \u767b\u5165\u5f8c\u7684\u5e33\u865f\u53ea\u80fd\u5728\u81ea\u5df1\u7684\u5bb6\u76ee\u9304\u5167\u6d3b\u52d5<\/p>\n<p>echo &#8220;no&#8221; > \/etc\/pure-ftpd\/conf\/PAMAuthentication\n\u4e0d\u7531PAM\u8a8d\u8b49\uff0c\u50c5\u55ae\u7d14\u7684\u900f\u904eMySQL\u53bb\u8a8d\u8b49\n\u5982\u679c\u9019\u88e1\u6539\u70ba&#8221;yes&#8221;\uff0c\u5247\u5be6\u9ad4\u5e33\u865f\u8005\u4e5f\u80fd\u767b\u5165\u3002<\/p>\n<p>echo &#8220;no&#8221; > \/etc\/pure-ftpd\/conf\/UnixAuthentication\n\u4e0d\u7531\u7cfb\u7d71\u8a8d\u8b49\uff0c\u50c5\u55ae\u7d14\u7684\u900f\u904eMySQL\u53bb\u8a8d\u8b49<\/p>\n<p>echo &#8220;yes&#8221; > \/etc\/pure-ftpd\/conf\/NoAnonymous\n\u4e0d\u8b93\u533f\u540d\u7528\u6236\u767b\u5165<\/p>\n<p>echo &#8220;yes&#8221; > \/etc\/pure-ftpd\/conf\/CreateHomeDir\n\u767b\u5165\u5f8c\u6c92\u6709\u5bb6\u76ee\u9304\u6703\u81ea\u884c\u5efa\u7acb(\u4f3c\u4e4e\u53ea\u80fd\u7528\u5728\u5be6\u9ad4\u5e33\u865f\u4e0a)<\/p>\n<p>\u4e0a\u8ff0\u914d\u7f6e\u5f8c\u8acb\u91cd\u65b0\u555f\u52d5\n\/usr\/bin\/service pure-ftpd-mysql restart<\/p>\n<p>\u4e0a\u8ff0\u7da0\u8272\u90e8\u5206\u70ba\u60a8\u8981\u5728\u7d42\u7aef\u6a5f\u8f38\u5165\u7684\u6307\u4ee4\n\u5230\u76ee\u524d\u70ba\u6b62\u662f\u6c92\u6709\u4efb\u4f55\u4eba\u53ef\u4ee5\u767b\u5165FTP\u7684\uff0c\n\u56e0\u70ba\u6211\u5011\u9023\u8cc7\u6599\u5eab\u7684\u9023\u7dda\u90fd\u9084\u6c92\u8a2d\u5b9a\uff0cPureFTP\u6839\u672c\u9084\u9023\u4e0d\u5230\u8cc7\u6599\u5eab\uff0c\n\u66f4\u4e0d\u7528\u8aaa\u53ef\u4ee5\u53d6\u5230\u8cc7\u6599\u8868\u7684\u5e33\u865f\u8cc7\u6599\u53bb\u8a8d\u8b49\u4e86\u3002<\/p>\n<p>\u4e8c\u3001\u8cc7\u6599\u5eab\u8a2d\u5b9a\u8207\u914d\u7f6e<\/p>\n<p>\u8cc7\u6599\u5eab\u9023\u7dda\u7684\u914d\u7f6e\u6a94\u5728\/etc\/pure-ftpd\/db\/mysql.conf \u5167\n(\u6a94\u6848\u5167\u6240\u6709\u524d\u9762\u6709#\u865f\u7684\u884c\u8868\u793a\u662f\u8a3b\u89e3)\n\u6240\u4ee5\u9019\u500b\u6a94\u6848\u96d6\u7136\u5167\u5bb9\u5f88\u591a\uff0c\u4f46\u5176\u5be6\u53ea\u6709\u4e0b\u9762\u5e7e\u884c\u624d\u662f\u88ab\u4f7f\u7528\u5230\u7684\u8a2d\u5b9a:\n\u4e0b\u9762\u662f\u4e00\u500b Ubuntu \u7cfb\u7d71\u5b89\u88dd pure-ftpd-mysql \u5f8c\n\u5728\/etc\/pure-ftpd\/db\/mysql.conf \u5167\u8cc7\u6599\u5eab\u9023\u7dda\u914d\u7f6e\u6a94\u7684\u9810\u8a2d\u503c\u3002<\/p>\n<p>MYSQLSocket      \/var\/run\/mysqld\/mysqld.sock\nMYSQLUser       root\nMYSQLPassword   rootpw\nMYSQLDatabase   pureftpd\nMYSQLCrypt      cleartext\nMYSQLGetPW      SELECT Password FROM users WHERE User=&#8221;\\L&#8221;\nMYSQLGetUID     SELECT Uid FROM users WHERE User=&#8221;\\L&#8221;\nMYSQLGetGID     SELECT Gid FROM users WHERE User=&#8221;\\L&#8221;\nMYSQLGetDir     SELECT Dir FROM users WHERE User=&#8221;\\L&#8221;<\/p>\n<p>\u4ee5\u4e0b\u6211\u5011\u9010\u884c\u89e3\u8aaa\u5176\u8a2d\u5b9a\u5167\u5bb9:\nMYSQLSocket      \/var\/run\/mysqld\/mysqld.sock\n\u9019\u884c\u8aaa\u660e MySQL \u63a5\u53e3\u7684\u4f4d\u7f6e,\u9664\u975e\u60a8\u662f\u81ea\u884c\u7de8\u8b6f\u7684..\u5426\u5247\u4e0d\u9808\u6539\u8b8a\u5b83\u3002<\/p>\n<p>MYSQLUser       root\n\u9019\u884c\u662f\u6307\u9023\u7dda\u5230\u8cc7\u6599\u5eab\u7684\u5e33\u865f\uff0c\u6211\u5011\u53ef\u4ee5\u4f9d\u7167\u63a1\u7528root\u5e33\u865f\u5373\u53ef\u3002<\/p>\n<p>MYSQLPassword   rootpw\n\u9019\u884c\u662f\u6307\u9023\u7dda\u5230\u8cc7\u6599\u5eab\u5e33\u865f\u6240\u7528\u7684\u5bc6\u78bc\uff0c\u60a8\u8981\u914d\u5408\u60a8\u7684\u8cc7\u6599\u5eab\u5bc6\u78bc\u4f5c\u6539\u8b8a\n\u9019\u662f\u57fa\u672c\u7528\u6cd5\u4e0b..\u60a8\u552f\u4e00\u8981\u8b8a\u66f4\u7684\u5730\u65b9\u3002<\/p>\n<p>MYSQLDatabase   pureftpd\n\u9019\u884c\u662f\u6307\u9023\u7dda\u5230\u8cc7\u6599\u5eab\u5f8c\uff0c\u8981\u4f7f\u7528\u7684\u8cc7\u6599\u5eab\u540d\u7a31\uff0c\u5982\u679c\u60a8\u4f9d\u672c\u6587\u64cd\u4f5c\u60a8\u4e5f\u4e0d\u9808\u4f5c\u6539\u8b8a\u3002<\/p>\n<p>MYSQLCrypt      cleartext\n\u9019\u884c\u662f\u6307\u865b\u64ec\u7528\u6236\u7684\u5bc6\u78bc\uff0c\u8981\u4f7f\u7528\u4f55\u8005\u7de8\u78bc\u65b9\u5f0f\uff0c\u5982\u679c\u60a8\u4f9d\u672c\u6587\u64cd\u4f5c\u60a8\u4e5f\u4e0d\u9808\u4f5c\u6539\u8b8a\u3002\n\u53ef\u7528\u7684\u8a2d\u5b9a\u503c\u6709\u4e0b\u9762\u5e7e\u500b\ncleartext \u660e\u78bc(\u4e0d\u984d\u5916\u7de8\u78bc)  md5 \u4f7f\u7528MD5\u7de8\u78bc\u52a0\u5bc6  crypt \u7528DES\u7de8\u78bc\u52a0\u5bc6\npassword MySQL\u7684\u7de8\u78bc\u52a0\u5bc6<br \/>\nany  \u6307\u53ef\u4ee5\u8996\u8cc7\u6599\u5eab\u6b04\u4f4d\u5b9a\u7fa9\u800c\u81ea\u52d5\u64c7\u7528md5\u3001crypt\u6216 password\u4e09\u7a2e\u7de8\u78bc\u65b9\u5f0f\u3002<\/p>\n<p>\u63a5\u4e0b4\u884c\u8a2d\u5b9a\u90fd\u662f\u8cc7\u6599\u5eab\u8a9e\u6cd5\u3002\nMYSQLGetPW      SELECT Password FROM users WHERE User=&#8221;\\L&#8221;\n\u4e0a\u8ff0\u8868\u793a\u7576\u865b\u64ec\u5e33\u865f\u7b26\u5408User\u6b04\u4f4d\u6642\uff0c\u9078\u53d6\u767b\u5165\u8005\u7684\u5bc6\u78bc\u6b04\u3002<\/p>\n<p>MYSQLGetUID     SELECT Uid FROM users WHERE User=&#8221;\\L&#8221;\n\u4e0a\u8ff0\u8868\u793a\u7576\u865b\u64ec\u5e33\u865f\u7b26\u5408User\u6b04\u4f4d\u6642\uff0c\u9078\u53d6\u767b\u5165\u8005\u7684\u4f7f\u7528\u8005ID\u3002\n\u7576\u4f7f\u7528\u8005\u767b\u5165\u5f8c\u5132\u5b58\u6a94\u6848\u90fd\u6703\u6709\u9019\u7a2e\u4f7f\u7528\u8005ID\u3001\u70ba\u4e86\u5b89\u5168\u6027\u8d77\u898b\n\u60a8\u8981\u907f\u514d\u7528\u7cfb\u7d71\u4f7f\u7528\u7684ID\u3002<\/p>\n<p>MYSQLGetGID     SELECT Gid FROM users WHERE User=&#8221;\\L&#8221;\n\u4e0a\u8ff0\u8868\u793a\u7576\u865b\u64ec\u5e33\u865f\u7b26\u5408User\u6b04\u4f4d\u6642\uff0c\u9078\u53d6\u767b\u5165\u8005\u7684\u7fa4\u7d44ID\u3002<\/p>\n<p>MYSQLGetDir     SELECT Dir FROM users WHERE User=&#8221;\\L&#8221;\n\u4e0a\u8ff0\u8868\u793a\u7576\u865b\u64ec\u5e33\u865f\u7b26\u5408User\u6b04\u4f4d\u6642\uff0c\u9078\u53d6\u767b\u5165\u8005\u7684\u5bb6\u76ee\u9304(\u6a94\u6848\u5b58\u53d6\u76ee\u9304)\u3002\n\u9019\u610f\u5473\u8457\u6211\u5011\u53ef\u4ee5\u5728\u8cc7\u6599\u8868\u7684 Dir \u6b04\u4f4d\u5167\uff0c\u4efb\u610f\u8a2d\u5b9a\u4f7f\u7528\u8005\u7684\u6a94\u6848\u5b58\u53d6\u76ee\u9304\u3002\n\u597d\u5922\u5e7b\u7684\u529f\u80fd\uff0c\u771f\u4ee4\u4eba\u6fc0\u8cde\u3002<\/p>\n<p>\u4e0a\u8ff0\u7684\u7528\u6cd5\u90fd\u53ea\u7528\u5230\u4e86&#8221;\\L&#8221;\uff0c\u800c&#8221;\\L&#8221;\u8868\u793a\u901a\u904e\u8a8d\u8b49\u5f8c\u7684\u4f7f\u7528\u8005\u5e33\u865f\u3002\n\u9664\u4e86&#8221;\\L&#8221;\u5916\uff0cpure-ftpd \u9084\u63d0\u4f9b\u4e86 \\I\u3001\\P\u3001\\R\u3001\\D \u56db\u500b\u7b26\u865f\u3002\n\u5206\u5225\u8868\u793a\u5982\u4e0b\uff1a\n\\I (\u76ee\u7684)\u865b\u64ec\u5e33\u865f\u9023\u7dda\u7684IP\n\\P (\u76ee\u7684)\u865b\u64ec\u5e33\u865f\u9023\u7dda\u901a\u8a0a\u57e0(21\u57e0)\n\\R (\u4f86\u6e90)\u865b\u64ec\u5e33\u865f\u5f9e\u90a3\u500bIP\u9023\u7dda\u904e\u4f86\u7684\n\\D (\u4f86\u6e90)\u865b\u64ec\u5e33\u865f\u5f9e\u90a3\u500bIP\u9023\u7dda\u904e\u4f86\u7684,\u540c\u4e0a,\u4f46\u4ee5\u6578\u4f4d\u8868\u793a\u3002<\/p>\n<p>\u4f9d\u4e0a\u8ff0\u6240\u8a00\uff0c\u6211\u5011\u8a8d\u8b49\u7684\u8cc7\u6599\u5eab pureftpd \u5167\uff0c\n\u9808\u6709\u4e00\u500b\u8cc7\u6599\u8868\u53ebusers\uff0c\u8cc7\u6599\u8868\u5167\n\u81f3\u5c11\u9808\u5177\u6709\u4e94\u500b\u6b04\u4f4d User,Password,Uid,Gid,Dir\n\u9019\u6a23\u624d\u80fd\u904b\u4f5c\u8d77\u4f86\uff0c\u4e0b\u9762\u70ba\u6574\u7406\u51fa\u7684\u5efa\u8868\u8a9e\u6cd5\u3002<\/p>\n<p>CREATE TABLE <code>users<\/code> (\n<code>User<\/code> varchar(16) NOT NULL DEFAULT &#8221;,\n<code>Password<\/code> varchar(64) NOT NULL DEFAULT &#8221;,\n<code>Uid<\/code> varchar(11) NOT NULL DEFAULT &#8216;-1&#8217;,\n<code>Gid<\/code> varchar(11) NOT NULL DEFAULT &#8216;-1&#8217;,\n<code>Dir<\/code> varchar(250) NOT NULL DEFAULT &#8221;,\nPRIMARY KEY (<code>User<\/code>),\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;<\/p>\n<p>\u641e\u6e05\u695a\u9019\u4e9b\u5148\u524d\u77e5\u8b58\u5f8c\uff0c\u63a5\u8457\u6211\u5011\u8981\u958b\u59cb\u4f86\u5efa\u7acb\u8cc7\u6599\u5eab\u53ca\u8cc7\u6599\u8868\u4e86<\/p>\n<p>[\u64cd\u4f5c\u6307\u4ee4]\nmysql -u root -p\nEnter password: (\u8f38\u5165\u8cc7\u6599\u5eabroot\u5bc6\u78bc\u5f8c\u6309\u78ba\u5b9a)<\/p>\n<p>\u5728\u5927\u65bc\u63d0\u793a\u7b26\u4e0b\u8f38\u5165\nCREATE DATABASE pureftpd;[\u6309\u78ba\u5b9a]\nUSE pureftpd;[\u6309\u78ba\u5b9a]<\/p>\n<p>\u5c07\u5efa\u8868\u8a9e\u6cd5\u8907\u88fd\u8cbc\u4e0a\u5f8c\u518d\u6309\u78ba\u5b9a<\/p>\n<p>\u56de\u9867\u9019\u90e8\u5206\u6211\u5011\u50c5\u9808\u505a3\u500b\u52d5\u4f5c<\/p>\n<p>1.\u6539\u8a2d\u5b9a\u6a94\u5167\u7684\u8cc7\u6599\u5eab\u5bc6\u78bc\n2.\u767b\u5165\u5230\u8cc7\u6599\u5eab\u5167\u5efa\u7acb\u4e00\u500bpureftpd\u8cc7\u6599\u5eab\n3.\u5efa\u7acb\u8cc7\u6599\u8868<\/p>\n<p>\u9019\u4e09\u90e8\u5206\u90fd\u5b8c\u6210\u4e86,\u60a8\u53ef\u4ee5\u91cd\u65b0\u555f\u52d5pureftp\u4f3a\u670d\u5668\nservice pure-ftpd-mysql restart<\/p>\n<p>\u63a5\u8457\u60a8\u53ef\u4ee5\u7c21\u4fbf\u7684\u5229\u7528phpMyAdmin\u53bb\u5efa\u7acb\u5e33\u865f\n\u518d\u5229\u7528\u5efa\u7acb\u7684\u5e33\u865f\u6e2c\u8a66\u767b\u5165\u770b\u770b\u3002<\/p>\n<p>If you want to use uid and gid of www-data, it doesn&#8217;t work. Because by fault in Debian the minimum uid is 1000. You will see the following error.<\/p>\n<p>Client side:<\/p>\n<p>$ ftp example.com\nConnected to example.com.\n220&#8212;&#8212;&#8212;- Welcome to Pure-FTPd [privsep] [TLS] &#8212;&#8212;&#8212;-\n220-You are user number 1 of 50 allowed.\n220-Local time is now 14:28. Server port: 21.\n220-This is a private system &#8211; No anonymous login\n220-IPv6 connections are also welcome on this server.\n220 You will be disconnected after 15 minutes of inactivity.\nName (example.com:haoyu): site.example.com\n331 User site.example.com OK. Password required\nPassword:\n530 Sorry, but I can&#8217;t trust you\nLogin failed.\nRemote system type is UNIX.\nUsing binary mode to transfer files.\nServer side in \/var\/log\/ftp.log:<\/p>\n<p>Sep 17 14:46:25 sd-xxxxx pure-ftpd: (?@defxx-x-xx-xxx-xx-xxx.fbx.proxad.net) [INFO] New connection from defxx-x-xx-xxx-xx-xxx.fbx.proxad.net\nSep 17 14:46:32 sd-xxxxx pure-ftpd: (?@defxx-x-xx-xxx-xx-xxx.fbx.proxad.net) [WARNING] Can&#8217;t login as [site.example.com]: account disabled\nThe solution is to modify \/etc\/pure-ftpd\/conf\/MinUID value from 1000 to 33. I suggest to disable PAM authentication (system user login) by write \u201cno\u201d in file \/etc\/pure-ftpd\/conf\/PAMAuthentication. :!:Don&#8217;t forget to restart Pure-FTPd server.<\/p>\n<p>[ERROR] Home directory not available &#8211; aborting<\/p>\n<p>Even you have put &#8216;yes&#8217; in \/etc\/pure-ftpd\/conf\/CreateHomeDir, Pure-FTPd will not create the user root directory, and you got \u201d[ERROR] Home directory not available &#8211; aborting\u201d in your syslog. The solution is change the owner to root of the last existing directory in the home path. For example:\nThe user root directory is \/home\/ftp\/user01 and \/home\/ftp should own be root<\/p>\n<h1>ls -al \/home\/<\/h1>\n<h1>drwxr-xr-x  4 root      ftp       4096 jui  4 21:57 ftp<\/h1>","protected":false},"excerpt":{"rendered":"<p>\u61c9\u7528\u8da8\u52e2 Pure-ftpd\u662f\u4e00\u500b\u5f88\u65b9\u4fbf\u7ba1\u7406\u7684FTP\u4f3a\u670d\u5668 \u6211\u5011\u5229\u7528\u5b83\u4f86\u63d0\u4f9b\u57fa\u672c\u7684FTP\u670d\u52d9\u662f\u5f88\u5bb9\u6613\u7684 \u5728 Ubuntu \u4e0b\u5b83\u6709\u5e7e\u500b\u5b89\u88dd\u985e\u578b\u9078\u64c7 (\u4ed6\u5011\u9593\u5f7c\u6b64\u4e92\u65a5..\u53ea\u80fd\u88dd\u4e00\u985e) 1.\u539f\u59cb\u800c\u55ae\u7d14\u7684\u7528\u6cd5&#46;&#46;&#46;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[364,100,363,7],"class_list":["post-1123","post","type-post","status-publish","format-standard","hentry","category-linux","tag-ftp","tag-mysql","tag-pure","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/comments?post=1123"}],"version-history":[{"count":2,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1123\/revisions"}],"predecessor-version":[{"id":1125,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1123\/revisions\/1125"}],"wp:attachment":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/media?parent=1123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/categories?post=1123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/tags?post=1123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}