{"id":96,"date":"2022-01-04T18:40:12","date_gmt":"2022-01-04T10:40:12","guid":{"rendered":"http:\/\/yliyun.com\/blogs\/?p=96"},"modified":"2022-01-04T18:40:12","modified_gmt":"2022-01-04T10:40:12","slug":"ftp%e4%b8%8e%e4%b8%80%e7%b2%92%e4%ba%91%e7%9b%98%ef%bc%88%e7%bd%91%e7%9b%98%ef%bc%89%e7%9a%84%e5%af%b9%e6%af%94","status":"publish","type":"post","link":"http:\/\/www.yliyun.com\/2022\/01\/04\/ftp%e4%b8%8e%e4%b8%80%e7%b2%92%e4%ba%91%e7%9b%98%ef%bc%88%e7%bd%91%e7%9b%98%ef%bc%89%e7%9a%84%e5%af%b9%e6%af%94\/","title":{"rendered":"FTP\u4e0e\u4e00\u7c92\u4e91\u76d8\uff08\u7f51\u76d8\uff09\u7684\u5bf9\u6bd4"},"content":{"rendered":"\n
\u51e0\u4e4e\u6bcf\u4e2a\u4f01\u4e1a\u90fd\u4f7f\u7528\u8fc7\u6216\u4ecd\u6b63\u5728\u4f7f\u7528\u6587\u4ef6\u4f20\u8f93\u534f\u8bae\uff08FTP\uff09\u6765\u5b9e\u73b0\u6587\u6863\u7684\u4f20\u8f93\u3002\u81ea\u4ece1971\u5e74\u7b2c\u4e00\u6807\u51c6\u7248\u672c\u7684\u53d1\u5e03\uff0c\u5df2\u7ecf\u6709\u5f88\u591a\u79cd\u4e0d\u540c\u7684FTP\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef\u51fa\u73b0\u3002ftp \u5177\u6709\u5df2\u4e0b\u7279\u70b9\uff1a<\/p>\n\n\n\n\n\n\n\n
\u6587\u4ef6\u4f20\u8f93\u534f\u8bae\uff08FTP\uff09\u6709\u4e00\u4e2a\u6f2b\u957f\u7684\u6f14\u5316\u53f2\uff0c\u662f\u4e92\u8054\u7f51\u4e0a\u6700\u91cd\u8981\u7684\u5e94\u7528\u4e4b\u4e00\uff0c\u4f46\u65f6\u81f3\u4eca\u65e5\uff0c\u5374\u5df2\u6c5f\u6cb3\u65e5\u4e0b\uff1b\u4ee5\u4e0b\u7684\u51e0\u4e2a\u7f3a\u70b9\u4e00\u76f4\u4e3a\u4eba\u8bdf\u75c5\u7684\u7f3a\u70b9<\/p>\n\n\n\n
1. \u00a0\u6570\u636e\u4f20\u8f93\u6a21\u5f0f\u4e0d\u5408\u7406\uff08\u5bfc\u81f4\u4e71\u7801\uff09<\/strong><\/p>\n\n\n\n \u4e0d\u8003\u8651\u6587\u4ef6\u81ea\u8eab\u7684\u5185\u5bb9\uff0c\u4e00\u5473\u4f7f\u7528ASCII\u6a21\u5f0f\u4f20\u8f93\u6570\u636e\u662f\u4e0d\u5408\u7406\u7684\u3002\u6587\u4ef6\u4f20\u8f93\u534f\u8bae\uff08FTP\uff09\u5e94\u8be5\u5177\u6709\u81ea\u52a8\u68c0\u6d4b\u529f\u80fd\uff0c\u5f53\u7136\u7528\u6237\u4e5f\u53ef\u4ee5\u8fdb\u884c\u81ea\u5b9a\u4e49\u3002\u867d\u7136\u73b0\u5728\u8bb8\u591aLinux\u548cWindows\u5ba2\u6237\u7aef\u5df2\u7ecf\u652f\u6301\u81ea\u52a8\u4f20\u8f93\u6a21\u5f0f\uff0c\u4f46\u591a\u8fbe\u6570\u4ee3\u7684UNIX\u548cWindows\u5ba2\u6237\u7aef\u90fd\u9ed8\u8ba4\u4f7f\u7528ASCII\u4f20\u8f93\u6a21\u5f0f\uff0c\u8fd9\u79cd\u4f20\u8f93\u6a21\u5f0f\u751a\u81f3\u4f1a\u9020\u6210\u6587\u4ef6\u635f\u574f\u3002<\/p>\n\n\n\n 2. \u00a0\u8bbe\u8ba1\u4e0d\u5408\u7406\uff08\u5b89\u5168\u95ee\u9898\uff09<\/strong><\/p>\n\n\n\n \u6587\u4ef6\u4f20\u8f93\u534f\u8bae\uff08FTP\uff09\u53ef\u4ee5\u5728\u4e3b\u52a8\u6a21\u5f0f\uff08PORT\uff09\u6216\u88ab\u52a8\u6a21\u5f0f\uff08PASV\uff09\u4e0b\u5de5\u4f5c\uff0c\u8fd9\u51b3\u5b9a\u4e86\u6570\u636e\u94fe\u63a5\u5efa\u7acb\u7684\u65b9\u5f0f\u3002\u5728\u4e3b\u52a8\u6a21\u5f0f\u4e0b\uff0c\u5ba2\u6237\u7aef\u9996\u5148\u5411\u670d\u52a1\u5668\u7aef\u53d1\u9001IP\u5730\u5740\u548c\u7aef\u53e3\u53f7\uff0c\u7136\u540e\u7b49\u5f85\u670d\u52a1\u5668\u7aef\u5efa\u7acbTCP\u94fe\u63a5\u3002\u5728\u88ab\u52a8\u6a21\u5f0f\u4e0b\uff0c\u5ba2\u6237\u7aef\u540c\u6837\u9996\u5148\u5efa\u7acb\u5230\u670d\u52a1\u5668\u7684\u94fe\u63a5\uff0c\u4f46\u670d\u52a1\u5668\u7aef\u4f1a\u5f00\u542f\u4e00\u4e2a\u7aef\u53e3\uff081024\u52305000\u4e4b\u95f4\uff09\uff0c\u7b49\u5f85\u5ba2\u6237\u7aef\u4f20\u8f93\u6570\u636e\u3002\u6587\u4ef6\u4f20\u8f93\u534f\u8bae\uff08FTP\uff09\u4e2d\u6700\u8ba9\u4eba\u4e0d\u53ef\u601d\u8bae\u7684\u662f\uff0c\u5ba2\u6237\u7aef\u4f1a\u4fa6\u542c\u670d\u52a1\u5668\u7aef\uff01<\/p>\n\n\n\n 3. \u00a0\u4e0e\u9632\u706b\u5899\u5de5\u4f5c\u4e0d\u534f\u8c03\uff08\u5b89\u5168\u95ee\u9898\uff09<\/strong><\/p>\n\n\n\n \u5728\u6587\u4ef6\u4f20\u8f93\u534f\u8bae\uff08FTP\uff09\u8bde\u751f\u5728\u7f51\u7edc\u5730\u5740\u8f6c\u6362\uff08NAT\uff09\u548c\u9632\u706b\u5899\u4e4b\u524d\uff0c\u90a3\u65f6\u7684\u7f51\u7edc\u8fd8\u4e0d\u5b58\u5728\u6076\u610f\u653b\u51fb\u3002\u4eca\u5929\u5927\u591a\u6570\u6700\u7ec8\u7528\u6237\u7684IPv4\u5730\u5740\u5df2\u4e0d\u53ef\u8def\u7531\uff0c\u8fd9\u662f\u56e0\u4e3a\u9632\u706b\u5899\u7684\u4f7f\u7528\u548cIPv4\u5730\u5740\u7684\u77ed\u7f3a\u3002<\/p>\n\n\n\n \u8fd9\u5bf9FTP\u610f\u5473\u7740\u4ec0\u4e48\u5462\uff1f\u8fd9\u610f\u5473\u7740\u5982\u679cFTP\u5ba2\u6237\u7aefIP\u5730\u5740\u4e0d\u53ef\u8def\u7531\uff0c\u6216\u8005\u4f4d\u4e8e\u9632\u706b\u5899\u4e4b\u540e\uff0c\u90a3\u4e48\u5c31\u53ea\u80fd\u4f7f\u7528\u88ab\u52a8\u4f20\u8f93\u6a21\u5f0f\u8fdb\u884c\u6570\u636e\u4f20\u8f93\u3002<\/p>\n\n\n\n \u5982\u679c\u670d\u52a1\u5668\u7aef\u7684IP\u5730\u5740\u4e5f\u4e0d\u53ef\u8def\u7531\uff0c\u6216\u8005\u4f4d\u4e8e\u9632\u706b\u5899\u4e4b\u540e\u5462\uff1fFTP\u5c06\u65e0\u6cd5\u8fdb\u884c\u6570\u636e\u4f20\u8f93\uff01<\/p>\n\n\n\n \u73b0\u5728\uff0c\u8bb8\u591a\u9632\u706b\u5899\u9002\u7528\u4e8eNAT\u73af\u5883\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u7279\u6b8a\u7684\u6280\u5de7\uff08hacks\uff09\u5141\u8bb8FTP\u5728\u9632\u706b\u5899\u4e4b\u540e\u6b63\u5e38\u5de5\u4f5c\u3002\u5f53\u7136\uff0c\u8fd9\u9700\u8981\u5bf9\u9632\u706b\u5899\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n\n\n\n 4. FTP\u534f\u8bae\u6548\u7387\u4f4e\u4e0b\uff08FTP 10\u6b21\u5f80\u8fd4\uff0chttp 2\u6b21\uff09<\/p>\n\n\n\n \u4eceFTP\u670d\u52a1\u5668\u4e0a\u68c0\u7d22\u4e00\u4e2a\u6587\u4ef6\uff0c\u5305\u542b\u7e41\u590d\u7684\u4ea4\u6362\u63e1\u624b\u6b65\u9aa4\uff1a<\/p>\n\n\n\n \u5ba2\u6237\u7aef\u5efa\u7acb\u5230FTP\u670d\u52a1\u5668\u7aef\u63a7\u5236\u7aef\u53e3\u7684TCP Socket\u94fe\u63a5\uff0c\u5e76\u7b49\u5f85TCP\u63e1\u624b\u5b8c\u6210\uff1b<\/p>\n\n\n\n \u5ba2\u6237\u7aef\u7b49\u5f85\u670d\u52a1\u5668\u7aef\u53d1\u9001\u56de\u6267\uff1b<\/p>\n\n\n\n \u5ba2\u6237\u7aef\u5411\u670d\u52a1\u5668\u7aef\u53d1\u9001\u7528\u6237\u540d\u5e76\u7b49\u5f85\u54cd\u5e94\uff1b<\/p>\n\n\n\n \u5ba2\u6237\u7aef\u5411\u670d\u52a1\u5668\u7aef\u53d1\u9001\u5bc6\u7801\u5e76\u7b49\u5f85\u54cd\u5e94\uff1b<\/p>\n\n\n\n \u5ba2\u6237\u7aef\u5411\u670d\u52a1\u5668\u7aef\u53d1\u9001SYST\u547d\u4ee4\u5e76\u7b49\u5f85\u54cd\u5e94\uff1b<\/p>\n\n\n\n \u5ba2\u6237\u7aef\u5411\u670d\u52a1\u5668\u7aef\u53d1\u9001TYPE I\u547d\u4ee4\u5e76\u7b49\u5f85\u54cd\u5e94\uff1b<\/p>\n\n\n\n \u5982\u679c\u7528\u6237\u9700\u8981\u5728\u670d\u52a1\u5668\u7aef\u5207\u6362\u76ee\u5f55\uff0c\u5ba2\u6237\u7aef\u4ecd\u7136\u53d1\u9001\u547d\u4ee4\u5e76\u7b49\u5f85\u54cd\u5e94\uff1b<\/p>\n\n\n\n \u4e3b\u52a8\u6a21\u5f0f\u4e0b\uff0c\u5ba2\u6237\u7aef\u9700\u8981\u53d1\u9001PORT\u547d\u4ee4\u5230\u670d\u52a1\u5668\u7aef\uff0c\u7136\u540e\u7b49\u5f85\u54cd\u5e94\uff08\u88ab\u52a8\u6a21\u5f0f\u4e0e\u4e3b\u52a8\u6a21\u5f0f\u76f8\u53cd\uff09\uff1b<\/p>\n\n\n\n \u5efa\u7acb\u6570\u636e\u4f20\u8f93\u94fe\u63a5\uff08\u9700\u8981\u7ecf\u8fc7\u4e09\u6b21\u63e1\u624b\uff0c\u5efa\u7acb\u4e00\u6761TCP Socket\u8fde\u63a5\uff09\uff1b<\/p>\n\n\n\n \u901a\u8fc7\u94fe\u63a5\u4f20\u8f93\u6570\u636e\uff1b<\/p>\n\n\n\n \u5ba2\u6237\u7aef\u7b49\u5f85\u670d\u52a1\u5668\u7aef\u4ece\u63a7\u5236\u8fde\u63a5\u53d1\u90012xx\u6307\u4ee4\uff0c\u4ee5\u786e\u4fdd\u6570\u636e\u4f20\u8f93\u6210\u529f\uff1b<\/p>\n\n\n\n \u5ba2\u6237\u7aef\u53d1\u9001QUIT\u547d\u4ee4\uff0c\u5e76\u7b49\u5f85\u670d\u52a1\u5668\u54cd\u5e94\uff1b<\/p>\n\n\n\n \u540c\u6837\u7684\u60c5\u5f62\uff0c\u6211\u4eec\u6765\u770b\u770bHTTP\u534f\u8bae\uff1a<\/p>\n\n\n\n HTTP\u5ba2\u6237\u7aef\u5411HTTP\u670d\u52a1\u5668\u7aef\u5efa\u7acb\u4e00\u6761TCP Socket\u8fde\u63a5\uff1b<\/p>\n\n\n\n HTTP\u5ba2\u6237\u7aef\u5411HTTP\u670d\u52a1\u5668\u7aef\u53d1\u9001GET\u547d\u4ee4\uff0c\u5305\u542bURL\u3001HTTP\u534f\u8bae\u7248\u672c\u3001\u865a\u62df\u4e3b\u673a\u540d\u7b49\u7b49\uff0c\u5e76\u7b49\u5f85\u54cd\u5e94\uff1b<\/p>\n\n\n\n HTTP\u670d\u52a1\u5668\u7aef\u7684\u54cd\u5e94\u5305\u542b\u4e86\u6240\u6709\u60f3\u8981\u7684\u6570\u636e\uff0c\u5b8c\u6210\uff01<\/p>\n\n\n\n \u4f20\u8f93\u4e00\u4e2a\u6587\u4ef6\uff0cFTP\u9700\u8981\u5f80\u590d10\u6b21\uff0c\u800cHTTP\u53ea\u9700\u89812\u6b21\uff01\u5982\u679c\u4f20\u8f93\u591a\u4e2a\u6587\u4ef6\uff0cFTP\u53ef\u4ee5\u7701\u7565\u53d1\u9001\u7528\u6237\u540d\u548c\u5bc6\u7801\u7684\u6b65\u9aa4\uff0c\u800cHTTP\u5219\u53ef\u4ee5\u4f7f\u7528\u56fa\u5b9a\u7684\u5957\u63a5\u5b57\uff08Socket\uff09\uff0c\u5728\u76f8\u540c\u7684TCP\u8fde\u63a5\u4e2d\u4f20\u8f93\u6587\u4ef6\u3002<\/p>\n\n\n\n FTP \u5ba2\u6237\u7aef\u529f\u80fd\u5355\u4e00\uff0c\u591a\u4eba\u534f\u540c\u4e0d\u4fbf\uff0c\u591a\u4e2a\u4eba\u529e\u516c\uff0c\u9700\u8981\u7ba1\u7406\u5458\u7528\u547d\u4ee4\u65b0\u5efa\u7528\u6237\uff1b\u6216\u8005\u7528\u7ba1\u7406\u7aef\u5de5\u5177\u65b0\u5efa\u7528\u6237\uff1b\u5bf9\u4e8e\u6587\u4ef6\u540c\u6b65\uff0c\u5927\u6587\u4ef6\u6570\u636e\u5907\u4efd\u7b49\u529f\u80fd\u65e0\u80fd\u4e3a\u529b\uff1b\u79fb\u52a8\u529e\u516c\u53ea\u6709\u7b2c\u4e09\u65b9\u5de5\u5177\uff0c\u5e76\u4e14\u6709\u4e25\u91cd\u7684\u7f51\u7edc\u5b89\u5168\u95ee\u9898\uff1b<\/p>\n\n\n\n\u4e00\u7c92\u4e91\u4f01\u4e1a\u7f51\u76d8\u7b80\u4ecb<\/strong><\/strong><\/h1>\n\n\n\n