SSH拷贝文件——scp命令
Last updated
2023-03-29 11:17:41
{"value":"scp \u662f secure copy \u7684\u7f29\u5199,scp \u662f linux \u7cfb\u7edf\u4e0b\u57fa\u4e8e ssh \u767b\u9646\u8fdb\u884c\u5b89\u5168\u7684\u8fdc\u7a0b\u6587\u4ef6\u62f7\u8d1d\u547d\u4ee4\u3002\n\n#### \u62f7\u8d1d\u8fdc\u7aef\u6587\u4ef6\u5230\u672c\u5730 ####\n\n scp \u8fdc\u7a0b\u7528\u6237\u540d@\u8fdc\u7a0bip:\u8def\u5f84\/\u6587\u4ef6\u540d(\u6587\u4ef6\u5939) \u672c\u5730\u8def\u5f84\n\n\u4f8b\uff1a\u4ece\u8fdc\u7a0b\u590d\u5236\u6587\u4ef6\u5230\u672c\u5730home\u76ee\u5f55\u4e0b\n\n [root@CDNCloud ~]# scp root@192.168.1.2:\/hmoe\/test01 \/home\n \n The authenticity of host '192.168.1.2 (192.168.1.2)' can't be established.\n ECDSA key fingerprint is SHA256:39lakKe9MyqJMO+CBHYkh9h84YsAj+tc\/fj0NRwKMtQ.\n ECDSA key fingerprint is MD5:2e:7e:22:51:87:98:06:31:41:0a:29:3a:e8:14:0d:8d.\n \n Are you sure you want to continue connecting (yes\/no)? yes #\u786e\u5b9a\u8fde\u63a5\n \n Warning: Permanently added '192.168.1.2' (ECDSA) to the list of known hosts.\n root@192.168.1.2's password: #\u8f93\u5165\u8fdc\u7a0b\u7aef\u673a\u5668\u5bc6\u7801\n \n test01 100% 3907 20.7KB\/s 00:00\n\n\n#### \u62f7\u8d1d\u672c\u5730\u6587\u4ef6\u5230\u8fdc\u7aef ####\n\n scp \u672c\u5730\u8def\u5f84\/\u6587\u4ef6\u540d \u8fdc\u7a0b\u7528\u6237\u540d@\u8fdc\u7a0bip:\u8def\u5f84\/\u6587\u4ef6\u540d\n\n\u4f8b\uff0c\u4e0a\u4f20\u672c\u5730test02\u6587\u4ef6\u5230\u8fdc\u7aefhome\u76ee\u5f55\u4e0b\u3002\n\n [root@CDNCloud ~]# scp \/home\/test02 root@192.168.1.2:\/home\n root@192.168.1.2's password: #\u8f93\u5165\u5bc6\u7801\n test02 100% 3907 20.9KB\/s 00:00 \n\n#### \u8bf4\u660e ####\n\n1.\u5982\u679c\u8fdc\u7a0b\u670d\u52a1\u5668\u9632\u706b\u5899\u6709\u4e3ascp\u547d\u4ee4\u8bbe\u7f6e\u4e86\u6307\u5b9a\u7684\u7aef\u53e3\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528 -P \u53c2\u6570\u6765\u8bbe\u7f6e\u547d\u4ee4\u7684\u7aef\u53e3\u53f7\uff0c\u547d\u4ee4\u683c\u5f0f\u5982\u4e0b\uff1a\n\n #scp \u547d\u4ee4\u4f7f\u7528\u7aef\u53e3\u53f7 6789\n scp -P 6789 root@192.168.1.2:\/hmoe\/test01 \/home\n\n2.\u4f7f\u7528scp\u547d\u4ee4\u8981\u786e\u4fdd\u4f7f\u7528\u7684\u7528\u6237\u5177\u6709\u53ef\u8bfb\u53d6\u8fdc\u7a0b\u670d\u52a1\u5668\u76f8\u5e94\u6587\u4ef6\u7684\u6743\u9650\uff0c\u5426\u5219scp\u547d\u4ee4\u662f\u65e0\u6cd5\u8d77\u4f5c\u7528\u7684\u3002"}