{"id":8304,"date":"2024-04-24T07:01:01","date_gmt":"2024-04-23T23:01:01","guid":{"rendered":""},"modified":"2024-04-24T07:01:01","modified_gmt":"2024-04-23T23:01:01","slug":"Linux\u4e2d\u4f20\u8f93\u6587\u4ef6\u5982\u4f55\u505a\u5230\u53c8\u5feb\u53c8\u5b89\u5168\uff1f\u540c\u5b66\uff0cscp\u547d\u4ee4\u4e86\u89e3\u4e00\u4e0b\uff01","status":"publish","type":"post","link":"https:\/\/mushiming.com\/8304.html","title":{"rendered":"Linux\u4e2d\u4f20\u8f93\u6587\u4ef6\u5982\u4f55\u505a\u5230\u53c8\u5feb\u53c8\u5b89\u5168\uff1f\u540c\u5b66\uff0cscp\u547d\u4ee4\u4e86\u89e3\u4e00\u4e0b\uff01"},"content":{"rendered":"

\n <\/path> \n<\/svg> <\/p>\n
\n

\u4f7f\u7528Linux\u65f6\uff0c\u4f20\u8f93\u6587\u4ef6\u662f\u7ecf\u5e38\u505a\u7684\u4e8b\u60c5\uff0c\u4f20\u8f93\u6587\u4ef6\u6709\u5f88\u591a\u79cd\u65b9\u5f0f\u3001\u4e5f\u6709\u5f88\u591a\u79cd\u534f\u8bae\uff0c\u6700\u5e38\u7528\u7684\u662frsync\u3001scp \u548c sftp\uff0c\u5728\u672c\u6587\uff0c\u745e\u54e5\u5c06\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e00\u4e0bscp\uff0c\u65e0\u8bba\u60a8\u662f\u652f\u6301\u5de5\u7a0b\u5e08\u3001\u7cfb\u7edf\u7ba1\u7406\u5458\u8fd8\u662f\u5f00\u53d1\u4eba\u5458\uff0c\u90fd\u53ef\u80fd\u9700\u8981\u4f7f\u7528 scp \u4f20\u8f93\u6587\u4ef6\u3002<\/p>\n

\u8ba9\u6211\u4eec\u76f4\u63a5\u5f00\u59cb\uff01<\/p>\n

<\/span>\u4ec0\u4e48\u662fscp\uff1f<\/span><\/span><\/h3>\n

scp\uff0c\u82f1\u6587\u5168\u79f0\uff1aSecure Copy Protocol<\/code>\uff0c\u4e2d\u6587\u540d\u79f0\uff1a\u5b89\u5168\u590d\u5236\u534f\u8bae\uff0c\u7528\u4e8e\u5728\u8ba1\u7b97\u673a\u7f51\u7edc\u4e0a\u7684\u4e3b\u673a\u4e4b\u95f4\u5b89\u5168\u5730\u4f20\u8f93\u6587\u4ef6\u3002<\/p>\n

scp\u901a\u8fc7\u4f7f\u7528SSH\uff08Secure Shell\uff09\u673a\u5236\u4f20\u8f93\u6587\u4ef6\u6765\u786e\u4fdd\u6570\u636e\u7684\u771f\u5b9e\u6027\u3001\u52a0\u5bc6\u548c\u673a\u5bc6\u6027\u3002\u56e0\u6b64\uff0c\u4f20\u8f93\u4e2d\u7684\u6570\u636e\u53ef\u4ee5\u514d\u53d7\u7aa5\u63a2\u653b\u51fb\uff0c\u5ba2\u6237\u7aef\u53ef\u4ee5\u4f7f\u7528\u6b64\u534f\u8bae\u5411\u670d\u52a1\u5668\u4e0a\u4f20\u548c\u4e0b\u8f7d\u6587\u4ef6\u548c\u76ee\u5f55\uff0c\u5b83\u9700\u8981\u5bc6\u7801\u6216\u5bc6\u94a5\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\uff0cscp \u7684\u9ed8\u8ba4\u7aef\u53e3\u662f TCP \u7aef\u53e3 22<\/strong>\uff0c\u8fd9\u4e5f\u662f SSH \u7684\u9ed8\u8ba4\u7aef\u53e3\u3002<\/p>\n

\n

scp \u534f\u8bae\u7684\u597d\u5904<\/strong>\u662f\u60a8\u65e0\u9700\u542f\u52a8 FTP \u4f1a\u8bdd\u6216\u663e\u5f0f\u767b\u5f55\u8fdc\u7a0b\u4e3b\u673a\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93\u3002<\/p>\n<\/blockquote>\n

<\/span>\u5982\u4f55\u4f7f\u7528scp\uff1f<\/span><\/span><\/h3>\n

<\/span>scp\u8bed\u6cd5<\/span><\/span><\/h4>\n

\u5c06\u6587\u4ef6\u4ece\u672c\u5730\u590d\u5236\u5230\u8fdc\u7a0b\u4e3b\u673a\uff1a<\/p>\n

scp [\u9009\u9879] \u6e90\u6587\u4ef6 \u7528\u6237\u540d@\u76ee\u7684\u4e3b\u673a:\u76ee\u7684\u8def\u5f84
<\/code><\/pre>\n

\u5c06\u6587\u4ef6\u4ece\u4ece\u8fdc\u7a0b\u4e3b\u673a\u590d\u5236\u5230\u672c\u5730\uff1a<\/p>\n

scp [\u9009\u9879] \u7528\u6237\u540d@\u6e90\u4e3b\u673a:\u6e90\u6587\u4ef6\u8def\u5f84 \u76ee\u6807\u6587\u4ef6
<\/code><\/pre>\n

\u8fd9\u91cc\u7684\u9009\u9879\u6709\u597d\u591a\uff0c\u6211\u4eec\u6267\u884c\u547d\u4ee4scp --help<\/code>\u770b\u770b\uff1a<\/p>\n

\n \"Linux\u4e2d\u4f20\u8f93\u6587\u4ef6\u5982\u4f55\u505a\u5230\u53c8\u5feb\u53c8\u5b89\u5168\uff1f\u540c\u5b66\uff0cscp\u547d\u4ee4\u4e86\u89e3\u4e00\u4e0b\uff01
\n <\/figure>\n

\u8fd9\u4e2a\u770b\u8d77\u6765\u4e0d\u5168\uff0c\u6211\u4eec\u6267\u884c\u547d\u4ee4man scp<\/code>\uff1a<\/p>\n

\n \"Linux\u4e2d\u4f20\u8f93\u6587\u4ef6\u5982\u4f55\u505a\u5230\u53c8\u5feb\u53c8\u5b89\u5168\uff1f\u540c\u5b66\uff0cscp\u547d\u4ee4\u4e86\u89e3\u4e00\u4e0b\uff01
\n <\/figure>\n
\n \"Linux\u4e2d\u4f20\u8f93\u6587\u4ef6\u5982\u4f55\u505a\u5230\u53c8\u5feb\u53c8\u5b89\u5168\uff1f\u540c\u5b66\uff0cscp\u547d\u4ee4\u4e86\u89e3\u4e00\u4e0b\uff01
\n <\/figure>\n
\n \"Linux\u4e2d\u4f20\u8f93\u6587\u4ef6\u5982\u4f55\u505a\u5230\u53c8\u5feb\u53c8\u5b89\u5168\uff1f\u540c\u5b66\uff0cscp\u547d\u4ee4\u4e86\u89e3\u4e00\u4e0b\uff01
\n <\/figure>\n

\u8fd9\u91cc\u6211\u9009\u51e0\u4e2a\u5e38\u7528\u7684\u89e3\u91ca\u4e00\u4e0b\uff1a<\/p>\n

    \n
  • \n
    \n -C : \u542f\u7528\u538b\u7f29\uff0c\u5728\u590d\u5236\u65f6\u63d0\u9ad8\u4f20\u8f93\u901f\u5ea6\u3002
    \n <\/section>\n<\/li>\n
  • \n
    \n -c <\u5bc6\u7801>\uff1a\u5bc6\u7801\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cSCP \u4f7f\u7528\u201cAES-128\u201d\u52a0\u5bc6\u6587\u4ef6\uff0c\u5982\u679c\u8981\u66f4\u6539\u5bc6\u7801\uff0c\u5219\u9700\u8981\u4f7f\u7528 -c \u9009\u9879\u540e\u8ddf\u5bc6\u7801\u540d\u79f0\u3002
    \n <\/section>\n<\/li>\n
  • \n
    \n -i <identity_file>\uff1a\u8bc6\u522b\u6587\u4ef6\u6216\u79c1\u94a5\uff0c\u901a\u5e38\u5728 Linux \u73af\u5883\u4e2d\u9009\u62e9\u57fa\u4e8e\u5bc6\u94a5\u7684\u8eab\u4efd\u9a8c\u8bc1\u3002
    \n <\/section>\n<\/li>\n
  • \n
    \n -l <limit>\uff1a\u9650\u5236\u5e26\u5bbd\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u8981\u4f7f\u7528\u7684\u6700\u5927\u5e26\u5bbd\uff0c\u4ee5 Kbits\/s \u4e3a\u5355\u4f4d\u3002
    \n <\/section>\n<\/li>\n
  • \n
    \n -B\uff1a\u5728\u590d\u5236\u65f6\u4f7f\u7528\u6279\u5904\u7406\u6a21\u5f0f\u3002
    \n <\/section>\n<\/li>\n
  • \n
    \n -F <ssh_config>\uff1a\u7528\u4e8e\u5728\u9700\u8981\u4f7f\u7528\u4e0d\u540c\u7f51\u7edc\u8fde\u63a5\u5230 Linux \u7cfb\u7edf\u7684\u60c5\u51b5\u4e0b\u590d\u5236\u65f6\u4f7f\u7528\u4e0d\u540c\u7684 ssh_config \u6587\u4ef6\u3002
    \n <\/section>\n<\/li>\n
  • \n
    \n -P <port>\uff1a\u5982\u679c\u76ee\u7684\u4e3b\u673a\u7684 ssh \u7aef\u53e3\u53f7\u4e0e\u9ed8\u8ba4\u7aef\u53e3\u53f7 22 \u4e0d\u540c\uff0c\u5219\u9700\u8981\u4f7f\u7528 -P \u9009\u9879\u7279\u522b\u6ce8\u660e\u7aef\u53e3\u53f7\u3002
    \n <\/section>\n<\/li>\n
  • \n
    \n -p\uff1a\u7528\u4e8e\u5728\u590d\u5236\u65f6\u4fdd\u7559\u6587\u4ef6\u6743\u9650\u3001\u4fee\u6539\u548c\u8bbf\u95ee\u65f6\u95f4\u3002
    \n <\/section>\n<\/li>\n
  • \n
    \n -q\uff1a\u5c06\u5728\u5b89\u9759\u6a21\u5f0f\u4e0b\u6267\u884c SCP \u547d\u4ee4\uff0c\u5c06\u5173\u95ed\u8fdb\u5ea6\u8868\uff0c\u5e76\u4e14\u4e0d\u4f1a\u5728 Linux \u7ec8\u7aef\u5c4f\u5e55\u4e0a\u663e\u793a ssh \u7684\u4f20\u8f93\u8fdb\u5ea6\u3001\u8b66\u544a\u6216\u8bca\u65ad\u6d88\u606f\u3002
    \n <\/section>\n<\/li>\n
  • \n
    \n -r\uff1a\u7528\u4e8e\u9012\u5f52\u590d\u5236\u6587\u4ef6\u548c\u76ee\u5f55\u3002
    \n <\/section>\n<\/li>\n
  • \n
    \n -S <program>\uff1a\u7528\u4e8e\u6307\u5b9a\u7528\u4e8e\u8fde\u63a5\u7684\u7a0b\u5e8f\u3002
    \n <\/section>\n<\/li>\n
  • \n
    \n -v\uff1a v \u4ee3\u8868\u8be6\u7ec6\uff0c\u5c06\u5728\u7ec8\u7aef\u5c4f\u5e55\u4e0a\u9010\u6b65\u663e\u793a SCP \u547d\u4ee4\u6267\u884c\u7684\u8fdb\u5ea6\u3002\u8fd9\u5bf9\u8c03\u8bd5\u5f88\u6709\u5e2e\u52a9\u3002
    \n <\/section>\n<\/li>\n<\/ul>\n

    <\/span>scp\u4f8b\u5b50<\/span><\/span><\/h4>\n

    \u6211\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u65b0\u5efa\u4e86\u4e00\u4e2awljlsmz\u7684\u6587\u4ef6\u5939\uff0c\u5e76\u4e14\u5728\u6b64\u6587\u4ef6\u5939\u4e2d\u65b0\u5efa\u4e86\u4e00\u4e2a\u6587\u4ef6hello_wljslmz\uff0c\u6587\u4ef6\u5185\u5bb9\u4e3a\u201chello , i am wljlsmz\u201d\uff1a<\/p>\n

    root@ecs-adf0-0003:\/tmp# mkdir  wljslmz<\/span>
    root@ecs-adf0-0003:\/tmp# cd wljslmz\/<\/span>
    root@ecs-adf0-0003:\/tmp\/wljslmz# ls<\/span>
    root@ecs-adf0-0003:\/tmp\/wljslmz# touch hello_wljslmz<\/span>
    root@ecs-adf0-0003:\/tmp\/wljslmz# vim hello_wljslmz<\/span>
    root@ecs-adf0-0003:\/tmp\/wljslmz# ls<\/span>
    hello_wljslmz
    root@ecs-adf0-0003:\/tmp\/wljslmz# more hello_wljslmz<\/span>
    hello , i am wljlsmz
    <\/code><\/pre>\n
    \n \"Linux\u4e2d\u4f20\u8f93\u6587\u4ef6\u5982\u4f55\u505a\u5230\u53c8\u5feb\u53c8\u5b89\u5168\uff1f\u540c\u5b66\uff0cscp\u547d\u4ee4\u4e86\u89e3\u4e00\u4e0b\uff01
    \n <\/figure>\n

    \u73b0\u5728\u6211\u5c06\u901a\u8fc7scp\u547d\u4ee4\u5c06\u6b64\u6587\u4ef6\u4e0b\u8f7d\u5230\u672c\u5730\uff0c\u5728\u672c\u5730\u8f93\u5165\uff1a<\/p>\n

    scp root@124.70.203.57:\/tmp\/wljslmz\/hello_wljslmz 
    <\/code><\/pre>\n

    \u6267\u884c\u8fc7\u7a0b\uff1a<\/p>\n

    \n \"Linux\u4e2d\u4f20\u8f93\u6587\u4ef6\u5982\u4f55\u505a\u5230\u53c8\u5feb\u53c8\u5b89\u5168\uff1f\u540c\u5b66\uff0cscp\u547d\u4ee4\u4e86\u89e3\u4e00\u4e0b\uff01
    \n <\/figure>\n

    \u901a\u8fc7\u4e0a\u56fe\u663e\u793a\uff0c\u5df2\u7ecf\u6210\u529f\u5c06\u8fdc\u7a0b\u7684\u6587\u4ef6\u590d\u5236\u5230\u672c\u5730\u4e86\uff0c\u662f\u4e0d\u662f\u5f88\u7b80\u5355\uff1f<\/p>\n

    <\/span>\u603b\u7ed3<\/span><\/span><\/h3>\n

    scp\u662f\u4e2a\u975e\u5e38\u91cd\u8981\u4e14\u57fa\u7840\u7684\u547d\u4ee4\uff0c\u672c\u6587\u4ecb\u7ecd\u4e86scp\u7684\u57fa\u7840\u77e5\u8bc6\u3001\u8bed\u6cd5\u3001\u53c2\u6570\u9009\u9879\u4ee5\u53ca\u4f8b\u5b50\uff0c\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u8ba4\u8bc6\u548c\u5b66\u4e60scp\u6709\u6240\u5e2e\u52a9\uff0c\u5982\u679c\u60a8\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u6b22\u8fce\u5728\u4e0b\u65b9\u8bc4\u8bba\u533a\u4e0e\u6211\u8ba8\u8bba\uff0c\u6700\u540e\u611f\u8c22\u60a8\u7684\u9605\u8bfb\uff0c\u60a8\u7684\u70b9\u8d5e\u548c\u8f6c\u53d1\u5c31\u662f\u6211\u4e0d\u65ad\u521b\u4f5c\u7684\u52a8\u529b\uff01<\/p>\n<\/section>\n","protected":false},"excerpt":{"rendered":"Linux\u4e2d\u4f20\u8f93\u6587\u4ef6\u5982\u4f55\u505a\u5230\u53c8\u5feb\u53c8\u5b89\u5168\uff1f\u540c\u5b66\uff0cscp\u547d\u4ee4\u4e86\u89e3\u4e00\u4e0b\uff01\u4f7f\u7528Linux\u65f6\uff0c\u4f20\u8f93\u6587\u4ef6\u662f\u7ecf\u5e38\u505a\u7684\u4e8b\u60c5\uff0c\u4f20\u8f93\u6587\u4ef6\u6709\u5f88\u591a\u79cd\u65b9\u5f0f\u3001...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/8304"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=8304"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/8304\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=8304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=8304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=8304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}