{"id":534,"date":"2019-04-27T21:57:29","date_gmt":"2019-04-27T13:57:29","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=534"},"modified":"2022-05-10T00:16:56","modified_gmt":"2022-05-09T16:16:56","slug":"scp","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/scp","title":{"rendered":"scp\u547d\u4ee4 – \u57fa\u4e8eSSH\u534f\u8bae\u8fdc\u7a0b\u590d\u5236\u6587\u4ef6"},"content":{"rendered":"\n

scp\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u8bcd\u7ec4\u201csecure copy\u201d\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u57fa\u4e8eSSH\u534f\u8bae\u8fdc\u7a0b\u62f7\u8d1d\u6587\u4ef6\u3002scp\u547d\u4ee4\u53ef\u4ee5\u5728\u591a\u53f0Linux\u7cfb\u7edf\u4e4b\u95f4\u590d\u5236\u6587\u4ef6\u6216\u76ee\u5f55 \uff0c\u6709\u4e9b\u7c7b\u4f3c\u4e8ecp\u547d\u4ee4\u7684\u529f\u80fd\uff0c\u4f46\u590d\u5236\u7684\u8303\u56f4\u5374\u4e0d\u662f\u672c\u5730\uff0c\u800c\u662f\u7f51\u7edc\u4e0a\u53e6\u4e00\u53f0\u4e3b\u673a\u3002<\/p>\n\n\n\n

\u7531\u4e8e\u662f\u57fa\u4e8eSSH\u534f\u8bae\u8fdb\u884c\u7684\u590d\u5236\u64cd\u4f5c\uff0c\u5168\u90e8\u6570\u636e\u90fd\u662f\u52a0\u5bc6\u7684\uff0c\u56e0\u6b64\u4f1a\u6bd4HTTP\u548cFTP\u66f4\u52a0\u5b89\u5168\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>scp \u53c2\u6570 \u6587\u4ef6<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong> <\/p>\n\n\n\n

-1<\/td>\u4f7f\u7528ssh\u534f\u8bae\u7248\u672c1-2<\/td><\/tr>
-2<\/td>\u4f7f\u7528ssh\u534f\u8bae\u7248\u672c2<\/td><\/tr>
-4<\/td>\u4f7f\u7528ipv4<\/td><\/tr>
-6<\/td>\u4f7f\u7528ipv6<\/td><\/tr>
-B<\/td>\u4ee5\u6279\u5904\u7406\u6a21\u5f0f\u8fd0\u884c<\/td><\/tr>
-C<\/td>\u4f7f\u7528\u538b\u7f29<\/td><\/tr>
-F<\/td>\u6307\u5b9assh\u914d\u7f6e\u6587\u4ef6<\/td><\/tr>
-l<\/td>\u6307\u5b9a\u5bbd\u5e26\u9650\u5236<\/td><\/tr>
-o<\/td>\u6307\u5b9a\u4f7f\u7528\u7684ssh\u9009\u9879<\/td><\/tr>
-P<\/td>\u6307\u5b9a\u8fdc\u7a0b\u4e3b\u673a\u7684\u7aef\u53e3\u53f7<\/td><\/tr>
-p<\/td>\u4fdd\u7559\u6587\u4ef6\u7684\u4fee\u6539\u65f6\u95f4\uff0c\u8bbf\u95ee\u65f6\u95f4\u548c\u6743\u9650\u6a21\u5f0f<\/td><\/tr>
-q<\/td>\u4e0d\u663e\u793a\u590d\u5236\u8fdb\u5ea6<\/td><\/tr>
-r<\/td>\u4ee5\u9012\u5f52\u65b9\u5f0f\u590d\u5236<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u5c06\u67d0\u4e2a\u672c\u5730\u6587\u4ef6\u590d\u5236\u5230\u6307\u5b9a\u7684\u8fdc\u7a0b\u4e3b\u673a\u7684\u6307\u5b9a\u76ee\u5f55\u4e2d\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# scp anaconda-ks.cfg 192.168.10.10:\/root<\/strong>  <\/pre>\n\n\n\n

\u5c06\u6307\u5b9a\u8fdc\u7a0b\u4e3b\u673a\u4e2d\u7684\u67d0\u4e2a\u6587\u4ef6\u590d\u5236\u5230\u672c\u5730\u5bb6\u76ee\u5f55\u4e2d\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# scp 192.168.10.10:\/root\/anaconda-ks.cfg \/root<\/strong><\/pre>\n\n\n\n

\u5c06\u67d0\u4e2a\u672c\u5730\u76ee\u5f55\u590d\u5236\u5230\u6307\u5b9a\u7684\u8fdc\u7a0b\u4e3b\u673a\u7684\u6307\u5b9a\u76ee\u5f55\u4e2d\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# scp -r Documents 192.168.10.10:\/root<\/strong><\/pre>\n\n\n\n

\u5c06\u6307\u5b9a\u8fdc\u7a0b\u4e3b\u673a\u4e2d\u7684\u67d0\u4e2a\u76ee\u5f55\u590d\u5236\u5230\u672c\u5730\u5bb6\u76ee\u5f55\u4e2d\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# scp -r 192.168.10.10:\/root\/Documents \/root<\/strong><\/pre>\n\n\n\n

\u5c06\u67d0\u4e2a\u672c\u5730\u6587\u4ef6\u590d\u5236\u5230\u6307\u5b9a\u7684\u8fdc\u7a0b\u4e3b\u673a\u7684\u6307\u5b9a\u76ee\u5f55\u4e2d\uff0c\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u4f20\u8f93\u7528\u6237\u8eab\u4efd\uff0c\u5e76\u4fdd\u7559\u539f\u59cb\u6587\u4ef6\u7684\u6743\u9650\u5c5e\u6027\u3002<\/p>\n\n\n\n

[root@linuxcool ~]# scp -p anaconda-ks.cfg linuxprobe@192.168.10.10:\/root<\/strong><\/pre>\n","protected":false},"excerpt":{"rendered":"

scp\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u8bcd\u7ec4\u201csecure copy\u201d\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u57fa\u4e8eSSH\u534f\u8bae\u8fdc\u7a0b\u62f7\u8d1d\u6587\u4ef6\u3002scp\u547d\u4ee4\u53ef […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/534"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=534"}],"version-history":[{"count":19,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/534\/revisions"}],"predecessor-version":[{"id":9426,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/534\/revisions\/9426"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}