{"id":67,"date":"2009-10-19T11:52:43","date_gmt":"2009-10-19T03:52:43","guid":{"rendered":"http:\/\/blog.infinity.idv.tw\/index.php\/2009\/10\/19\/ftp-%e7%9a%84%e4%b8%bb%e5%8b%95%e6%a8%a1%e5%bc%8f-active-%e5%92%8c%e8%a2%ab%e5%8b%95%e6%a8%a1%e5%bc%8f-passive\/"},"modified":"2009-10-19T11:52:43","modified_gmt":"2009-10-19T03:52:43","slug":"ftp-%e7%9a%84%e4%b8%bb%e5%8b%95%e6%a8%a1%e5%bc%8f-active-%e5%92%8c%e8%a2%ab%e5%8b%95%e6%a8%a1%e5%bc%8f-passive","status":"publish","type":"post","link":"http:\/\/blog.infinity.idv.tw\/?p=67","title":{"rendered":"FTP \u7684\u4e3b\u52d5\u6a21\u5f0f( active )\u548c\u88ab\u52d5\u6a21\u5f0f( passive )"},"content":{"rendered":"<p>FTP \u662f\u4e00\u7a2e\u6a94\u50b3\u8f38\u5354\u5b9a (File Transfer Protocol)\uff0c\u5b83\u7684\u9023\u7dda\u6a21\u5f0f\u6709\u5169\u7a2e\ufe55   <br \/>\u4e3b\u52d5\u6a21\u5f0f( active )\u548c\u88ab\u52d5\u6a21\u5f0f( passive )\u3002\u4ee5\u4e0b\u8aaa\u660e FTP \u7684\u9023\u7dda\u662f\u600e\u6a23\u5efa\u7acb\u7684\ufe55    <\/p>\n<p>\u5728 active \u6a21\u5f0f\u4e0b (\u4e00\u822c\u9810\u8a2d\u7684\u6a21\u5f0f)\ufe55   <br \/>1. FTP client \u958b\u555f\u4e00\u500b\u96a8\u6a5f\u9078\u64c7\u7684TCP port \u547c\u53eb FTP server \u7684 port 21\u8acb\u6c42\u9023\u7dda\u3002\u7576\u9806\u5229\u5b8c\u6210 Three-Way Handshake \u4e4b\u5f8c\uff0c\u9023\u7dda\u5c31\u6210\u529f\u5efa\u7acb\uff0c\u4f46\u9019\u50c5\u662f\u547d\u4ee4\u901a\u9053\u7684\u5efa\u7acb\u3002    <br \/>2.\u7576\u5169\u7aef\u9700\u8981\u50b3\u9001\u8cc7\u6599\u7684\u6642\u5019\uff0cclient \u900f\u904e\u547d\u4ee4\u901a\u9053\u7528\u4e00\u500b port command \u544a\u8a34 server\uff0cclient\u53ef\u4ee5\u7528\u53e6\u4e00\u500bTCP port \u505a\u6578\u64da\u901a\u9053\u3002    <br \/>3.\u7136\u5f8c server \u7528 port 20 \u548c\u525b\u624d client \u6240\u544a\u77e5\u7684 TCP port \u5efa\u7acb\u6578\u64da\u9023\u7dda\u3002\u8acb\u6ce8\u610f\uff1a\u9023\u7dda\u65b9\u5411\u9019\u662f\u5f9e server \u5230 client \u7684\uff0cTCP \u5c01\u5305\u6703\u6709\u4e00\u500b SYN flag\u3002    <br \/>4.\u7136\u5f8c client \u6703\u8fd4\u56de\u4e00\u500b\u5e36 ACK flag\u7684\u78ba\u8a8d\u5c01\u5305\ufe50\u4e26\u5b8c\u6210\u53e6\u4e00\u6b21\u7684 Three-Way Handshake \u624b\u7e8c\u3002\u9019\u6642\u5019\uff0c\u6578\u64da\u901a\u9053\u624d\u80fd\u6210\u529f\u5efa\u7acb\u3002    <br \/>5.\u958b\u59cb\u6578\u64da\u50b3\u9001\u3002    <\/p>\n<p>\u5728 passive \u6a21\u5f0f\u4e0b   <br \/>1.FTP client \u958b\u555f\u4e00\u500b\u96a8\u6a5f\u9078\u64c7\u7684TCP port \u547c\u53eb FTP server \u7684 port 21\u8acb\u6c42\u9023\u7dda\uff0c\u4e26\u5b8c\u6210\u547d\u4ee4\u901a\u9053\u7684\u5efa\u7acb\u3002    <br \/>2.\u7576\u5169\u7aef\u9700\u8981\u50b3\u9001\u8cc7\u6599\u7684\u6642\u5019\uff0cclient \u900f\u904e\u547d\u4ee4\u901a\u9053\u9001\u4e00\u500b PASV command \u7d66server\uff0c\u8981\u6c42\u9032\u5165 passive \u50b3\u8f38\u6a21\u5f0f\u3002    <br \/>3.\u7136\u5f8c server \u50cf\u4e0a\u8ff0\u7684\u6b63\u5e38\u6a21\u5f0f\u4e4b\u7b2c 2 \u6b65\u9a5f\u90a3\u6a23\uff0c\u6311\u4e00\u500bTCP port \uff0c\u4e26\u7528\u547d\u4ee4\u901a\u9053\u544a\u8a34 client\u3002    <br \/>4.\u7136\u5f8c client \u7528\u53e6\u4e00\u500bTCP port \u547c\u53eb\u525b\u624d server \u544a\u77e5\u7684 TCP port \u4f86\u5efa\u7acb\u6578\u64da\u901a\u9053\u3002\u6b64\u6642\u5c01\u5305\u5e36 SYN flag\u3002    <br \/>5.server \u78ba\u8a8d\u5f8c\u56de\u61c9\u4e00\u500b ACK \u5c01\u5305\u3002\u4e26\u5b8c\u6210\u6240\u6709\u4ea4\u63e1\u624b\u7e8c?\u6210\u529f\u5efa\u7acb\u6578\u64da\u901a\u9053\u3002    <br \/>6.\u958b\u59cb\u6578\u64da\u50b3\u9001\u3002    <\/p>\n<p>\u5728\u5be6\u969b\u4f7f\u7528\u4e0a, active mode \u7528\u4f86\u767b\u5165\u4e00\u4e9b\u958b\u8a2d\u5728\u4e3b\u6a5f\u4e0a\u53ca\u6c92\u6709\u5b89\u88dd\u9632\u706b\u7246\u7684 FTP server\uff0c\u6216\u662f\u958b\u8a2d\u65bc client side \u7684 FTP server\uff01   <br \/>Passive mode \uff08\u7c21\u7a31 PASV\uff09\u7528\u4f86\u767b\u5165\u4e00\u4e9b\u67b6\u8a2d\u65bc\u9632\u706b\u7246\u4fdd\u8b77\u4e0b\u800c\u53c8\u662f\u958b\u8a2d\u65bc\u4e3b\u6a5f\u4e0a\u7684 FTP server\uff01    <br \/>\u5982\u679c\u60a8\u89ba\u5f97\u592a\u6df1\u5967\u800c\u5f04\u4e0d\u6e05\u695a, \u90a3\u5c31\u5148\u7528\u9810\u8a2d\u7684 active mode \u767b\u5165, \u5931\u6557\u6539\u7528 passive mode \u767b\u5165\u5c31\u662f\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FTP \u662f\u4e00\u7a2e\u6a94\u50b3\u8f38\u5354\u5b9a (File Transfer Protocol)\uff0c\u5b83\u7684\u9023\u7dda\u6a21\u5f0f\u6709\u5169\u7a2e\ufe55   \u4e3b\u52d5\u6a21\u5f0f( active )\u548c\u88ab\u52d5\u6a21\u5f0f( passive )\u3002\u4ee5\u4e0b\u8aaa\u660e FTP \u7684\u9023\u7dda\u662f\u600e\u6a23\u5efa\u7acb\u7684\ufe55    <\/p>\n<p>\u5728 active \u6a21\u5f0f\u4e0b (\u4e00\u822c\u9810\u8a2d\u7684\u6a21\u5f0f)\ufe55   1. FTP client \u958b\u555f\u4e00\u500b\u96a8\u6a5f\u9078\u64c7\u7684TCP port \u547c\u53eb FTP server \u7684 port 21\u8acb\u6c42\u9023\u7dda\u3002\u7576\u9806\u5229\u5b8c\u6210 Three-Way Handshake \u4e4b\u5f8c\uff0c\u9023\u7dda\u5c31\u6210\u529f\u5efa\u7acb\uff0c\u4f46\u9019\u50c5\u662f\u547d\u4ee4\u901a\u9053\u7684\u5efa\u7acb\u3002    2.\u7576\u5169\u7aef\u9700\u8981\u50b3\u9001\u8cc7\u6599\u7684\u6642\u5019\uff0cclient \u900f\u904e\u547d\u4ee4\u901a\u9053\u7528\u4e00\u500b port command \u544a\u8a34 server\uff0cclient\u53ef\u4ee5\u7528\u53e6\u4e00\u500bTCP port \u505a\u6578\u64da\u901a\u9053\u3002    3.\u7136\u5f8c server \u7528 port [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[40],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.infinity.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/67"}],"collection":[{"href":"http:\/\/blog.infinity.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.infinity.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.infinity.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.infinity.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=67"}],"version-history":[{"count":0,"href":"http:\/\/blog.infinity.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.infinity.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.infinity.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.infinity.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}