{"id":52803,"date":"2023-06-06T02:05:12","date_gmt":"2023-06-05T18:05:12","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=52803"},"modified":"2023-06-06T02:05:12","modified_gmt":"2023-06-05T18:05:12","slug":"linux-sftp-files","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-sftp-files.html","title":{"rendered":"\u5728 Linux \u4e2d\u4f7f\u7528 sFTP \u4e0a\u4f20\u6216\u4e0b\u8f7d\u6587\u4ef6\u4e0e\u6587\u4ef6\u5939"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nsFTP\uff08\u5b89\u5168\u6587\u4ef6\u4f20\u8f93\u7a0b\u5e8f\uff09\u662f\u4e00\u79cd\u5b89\u5168\u7684\u4ea4\u4e92\u5f0f\u6587\u4ef6\u4f20\u8f93\u7a0b\u5e8f\uff0c\u5176\u5de5\u4f5c\u65b9\u5f0f\u4e0e FTP\uff08\u6587\u4ef6\u4f20\u8f93\u534f\u8bae\uff09\u7c7b\u4f3c\u3002 \u7136\u800c\uff0csFTP \u6bd4 FTP \u66f4\u5b89\u5168\uff1b\u5b83\u901a\u8fc7\u52a0\u5bc6 SSH \u4f20\u8f93\u5904\u7406\u6240\u6709\u64cd\u4f5c\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5b83\u53ef\u4ee5\u914d\u7f6e\u4f7f\u7528\u51e0\u4e2a\u6709\u7528\u7684 SSH \u529f\u80fd\uff0c\u5982\u516c\u94a5\u8ba4\u8bc1\u548c\u538b\u7f29\u3002 \u5b83\u8fde\u63a5\u5e76\u767b\u5f55\u5230\u6307\u5b9a\u7684\u8fdc\u7a0b\u673a\u5668\uff0c\u7136\u540e\u5207\u6362\u5230\u4ea4\u4e92\u5f0f\u547d\u4ee4\u6a21\u5f0f\uff0c\u5728\u8be5\u6a21\u5f0f\u4e0b\u7528\u6237\u53ef\u4ee5\u6267\u884c\u5404\u79cd\u547d\u4ee4\u3002<\/p>\n

\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u5411\u4f60\u5c55\u793a\u5982\u4f55\u4f7f\u7528 sFTP \u4e0a\u4f20\/\u4e0b\u8f7d\u6574\u4e2a\u76ee\u5f55\uff08\u5305\u62ec\u5176\u5b50\u76ee\u5f55\u548c\u5b50\u6587\u4ef6\uff09\u3002<\/p>\n

\u5982\u4f55\u5728 Linux \u4e2d\u4f7f\u7528 sFTP \u4f20\u8f93\u6587\u4ef6\/\u6587\u4ef6\u5939<\/strong><\/div>\n

\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cSFTP \u534f\u8bae\u91c7\u7528\u548c SSH \u4f20\u8f93\u534f\u8bae\u4e00\u6837\u7684\u65b9\u5f0f\u5efa\u7acb\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u5b89\u5168\u8fde\u63a5\u3002\u867d\u7136\uff0c\u7528\u6237\u9a8c\u8bc1\u4f7f\u7528\u7c7b\u4f3c\u4e8e SSH \u9ed8\u8ba4\u8bbe\u7f6e\u7684\u5bc6\u7801\u65b9\u5f0f\uff0c\u4f46\u662f\uff0c\u5efa\u8bae\u521b\u5efa\u548c\u4f7f\u7528 SSH \u65e0\u5bc6\u7801\u767b\u5f55\uff0c\u4ee5\u7b80\u5316\u548c\u66f4\u5b89\u5168\u5730\u8fde\u63a5\u5230\u8fdc\u7a0b\u4e3b\u673a\u3002<\/p>\n

\u8981\u8fde\u63a5\u5230\u8fdc\u7a0b sftp \u670d\u52a1\u5668\uff0c\u5982\u4e0b\u5efa\u7acb\u4e00\u4e2a\u5b89\u5168 SSH \u8fde\u63a5\u5e76\u521b\u5efa SFTP \u4f1a\u8bdd\uff1a<\/p>\n

$ sftp tecmint@192.168.56.10<\/pre>\n

\u767b\u5f55\u5230\u8fdc\u7a0b\u4e3b\u673a\u540e\uff0c\u4f60\u53ef\u4ee5\u5982\u4e0b\u8fd0\u884c\u4ea4\u4e92\u5f0f\u7684 sFTP \u547d\u4ee4\uff1a<\/p>\n

sftp> ls            #list directory \r\nsftp> pwd           #print working directory on remote host\r\nsftp> lpwd          #print working directory on local host\r\nsftp> mkdir uploads     #create a new directory\r\n<\/pre>\n

\"\u5982\u4f55\u5728<\/p>\n

\u5982\u4f55\u4f7f\u7528 sFTP \u4e0a\u4f20\u6587\u4ef6\u5939<\/strong><\/span><\/div>\n

\u8981\u5c06\u6574\u4e2a\u76ee\u5f55\u4e0a\u4f20\u5230\u8fdc\u7a0b Linux \u4e3b\u673a\u4e2d\uff0c\u8bf7\u4f7f\u7528put\u547d\u4ee4\u3002\u4f46\u662f\uff0c\u5982\u679c\u76ee\u5f55\u540d\u79f0\u4e0d\u5b58\u5728\u4e8e\u8fdc\u7a0b\u4e3b\u673a\u4e0a\u7684\u5de5\u4f5c\u76ee\u5f55\u4e2d\uff0c\u4f60\u5c06\u6536\u5230\u9519\u8bef\uff0c\u5982\u4e0b\u9762\u7684\u5c4f\u5e55\u622a\u56fe\u6240\u793a\u3002<\/p>\n

\u56e0\u6b64\uff0c\u9996\u5148\u5728\u8fdc\u7a0b\u4e3b\u673a\u4e0a\u521b\u5efa\u4e00\u4e2a\u5177\u6709\u76f8\u540c\u540d\u79f0\u7684\u76ee\u5f55\uff0c\u7136\u540e\u4ece\u672c\u5730\u4e3b\u673a\u4e0a\u4f20\u5b83\uff0c-r\u53c2\u6570\u5141\u8bb8\u62f7\u8d1d\u5b50\u76ee\u5f55\u548c\u5b50\u6587\u4ef6\uff1a<\/p>\n

sftp> put -r  Tecmint.com-articles\r\nsftp> mkdir Tecmint.com-articles\r\nsftp> put -r Tecmint.com-articles\r\n<\/pre>\n

\"\u5982\u4f55\u5728
\n\u8981\u4fdd\u7559\u4fee\u6539\u65f6\u95f4\u3001\u8bbf\u95ee\u65f6\u95f4\u4ee5\u53ca\u88ab\u4f20\u8f93\u7684\u6587\u4ef6\u7684\u6a21\u5f0f\uff0c\u8bf7\u4f7f\u7528-p\u6807\u5fd7\u3002<\/p>\n

sftp> put -pr Tecmint.com-articles<\/pre>\n
\u5982\u4f55\u4f7f\u7528 sFTP \u4e0b\u8f7d\u6587\u4ef6\u5939<\/strong><\/div>\n

\u8981\u4ece\u8fdc\u7a0b Linux \u4e3b\u673a\u4e0b\u8f7d\u6574\u4e2a fstools-0.0 \u6587\u4ef6\u5939\u5230\u672c\u673a\u4e2d\uff0c\u5982\u4e0b\u6240\u793a\u4f7f\u7528 get \u547d\u4ee4\u5e26\u4e0a-r\u6807\u5fd7\uff1a<\/p>\n

sftp> get -r fstools-0.0<\/pre>\n

\"\u5982\u4f55\u5728<\/p>\n

\u4f7f\u7528 sFTP \u4e0b\u8f7d\u76ee\u5f55<\/strong><\/div>\n

\u5982\u679c\u6587\u4ef6\u5939\u5df2\u7ecf\u4e0b\u8f7d\u5b8c\u6210\u4e86\uff0c\u63a5\u7740\u67e5\u770b\u672c\u673a\u7684\u5de5\u4f5c\u76ee\u5f55\u3002<\/p>\n

\u8981\u9000\u51fa sFTP shell\uff0c\u8f93\u5165\uff1a<\/p>\n

sftp> bye\u6216\u8005sftp> exit<\/pre>\n

\u8bf7\u6ce8\u610f\uff0c\u4e3a\u4e86\u9632\u6b62\u7528\u6237\u8bbf\u95ee\u8fdc\u7a0b\u4e3b\u673a\u4e0a\u7684\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\uff0c\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 chroot Jail\u5c06 sFTP \u7528\u6237\u9650\u5236\u5230\u5176\u4e3b\u76ee\u5f55\u4e2d\u3002<\/p>\n

\u5c31\u662f\u8fd9\u6837\u4e86\uff01\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5411\u4f60\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528 sFTP \u4e0a\u4f20\/\u4e0b\u8f7d\u6574\u4e2a\u76ee\u5f55\u3002<\/p>\n


\n

via: http:\/\/www.tecmint.com\/sftp-upload-download-directory-in-linux\/<\/a><\/p>\n

\u4f5c\u8005\uff1aAaron Kili<\/a> \u8bd1\u8005\uff1ageekpi<\/a> \u6821\u5bf9\uff1awxy<\/a><\/p>\n

\u672c\u6587\u7531 LCTT<\/a> \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd<\/a> \u8363\u8a89\u63a8\u51fa<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-8253-1.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/linux-sftp-files.html<\/a>\u7f16\u8f91\u5458\uff1a\u90ed\u5efa\u9e4f\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

sFTP\uff08\u5b89\u5168\u6587\u4ef6\u4f20\u8f93\u7a0b\u5e8f\uff09\u662f\u4e00\u79cd\u5b89\u5168\u7684\u4ea4\u4e92\u5f0f\u6587\u4ef6\u4f20\u8f93\u7a0b\u5e8f\uff0c\u5176\u5de5\u4f5c\u65b9\u5f0f\u4e0e FTP\uff08\u6587\u4ef6\u4f20\u8f93\u534f\u8bae\uff09\u7c7b\u4f3c\u3002 \u7136\u800c\uff0csFTP \u6bd4 FTP \u66f4\u5b89\u5168\uff1b\u5b83\u901a\u8fc7\u52a0\u5bc6 SSH \u4f20\u8f93\u5904\u7406\u6240\u6709\u64cd\u4f5c\u3002<\/p>\n","protected":false},"author":323,"featured_media":52993,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-52803","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/52803","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\/323"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=52803"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/52803\/revisions"}],"predecessor-version":[{"id":274276,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/52803\/revisions\/274276"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/52993"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=52803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=52803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=52803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}