{"id":6455,"date":"2022-06-22T09:04:42","date_gmt":"2022-06-22T01:04:42","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=6455"},"modified":"2022-06-22T09:28:36","modified_gmt":"2022-06-22T01:28:36","slug":"rsync-password-less-through-ssh","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/rsync-password-less-through-ssh.html","title":{"rendered":"\u65e0\u5bc6\u7801\u901a\u8fc7ssh\u6267\u884crsync"},"content":{"rendered":"
\n

\u672c\u6587\u7531lrxjmw.cn\u56e2\u961f\u6210\u5458\u70e8\u5b50<\/span>\u6574\u7406\u53d1\u5e03\uff0c\u539f\u6587\u6765\u81ea\uff1aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66<\/a>\u3002<\/p>\n<\/div>\n

\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5728\u6267\u884crsync\u547d\u4ee4\u65f6\u901a\u5e38\u9700\u8981\u6211\u4eec\u8f93\u5165\u5bc6\u7801\u3002\u4f46\u6709\u65f6\u6211\u4eec\u5e76\u4e0d\u5e0c\u671b\u5982\u6b64\uff0c\u90a3\u4e48\u5982\u4f55\u5b9e\u73b0\u65e0\u5bc6\u7801\u6267\u884crsync\u5462\uff1f<\/strong>
\n\"data_rsync\"<\/p>\n

1. \u6d4b\u8bd5\u901a\u8fc7ssh\u53ef\u4ee5\u6267\u884crsync\uff08\u9700\u8981\u5bc6\u7801\uff09<\/strong><\/div>\n

\u6267\u884crsync\uff0c\u786e\u4fdd\u4f60\u5e10\u6237\u7684\u5bc6\u7801\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u53ef\u4ee5\u4f7f\u7528\uff0c\u5e76\u80fd\u591f\u5c06\u6587\u4ef6\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002
\n\u4f8b\uff1a\u5c06\u672c\u5730\u76ee\u5f55 \/home\/linuxprobe\u540c\u6b65\u5230\u8fdc\u7a0b\u76ee\u5f55\/back\/linuxprobe(\u670d\u52a1\u5668\u5730\u5740\uff1a192.168.200.10) \uff0c\u6267\u884c\u6b64\u64cd\u4f5c\u65f6\uff0c\u670d\u52a1\u5668\u4f1a\u8981\u6c42\u4f60\u8f93\u5165\u5bc6\u7801<\/p>\n

rsync -avz -e ssh \/home\/linuxprobe \/ linuxprobe@192.168.200.10:\/backup\/linuxprobe\/\r\n<\/pre>\n
2. \u4f7f\u7528ssh-keygen\u751f\u6210\u5bc6\u5319<\/strong><\/div>\n

\u73b0\u5728\u6211\u4eec\u6765\u914d\u7f6essh\u4f7f\u5f97\u901a\u8fc7ssh\u6267\u884crsync\u65f6\u4e0d\u518d\u7d22\u8981\u5bc6\u7801\u3002\u5728\u672c\u5730\u670d\u52a1\u5668\u4e0a\u4f7f\u7528ssh-keygen\u751f\u6210\u516c\u94a5\u548c\u79d8\u94a5\u3002<\/p>\n

$ ssh-keygen\r\nEnter passphrase (empty for no passphrase):\r\nEnter same passphrase again:\r\n<\/pre>\n

\u6ce8\u610f\uff1a\u5f53\u5b83\u8981\u6c42\u60a8\u8f93\u5165passphrase\u6309\u4e0benter\u952e\uff0c\u4e0d\u9700\u8981\u7ed9\u4efb\u4f55\u5bc6\u7801\u3002<\/p>\n

3. \u4f7f\u7528ssh-copy-id\u5c06\u516c\u5319\u62f7\u8d1d\u81f3\u8fdc\u7a0b\u4e3b\u673a<\/strong><\/div>\n

\u4f7f\u7528ssh-copy-id\u547d\u4ee4\u5c06\u516c\u94a5\u62f7\u8d1d\u81f3\u8fdc\u7a0b\u4e3b\u673a<\/p>\n

ssh-copy-id -i ~\/.ssh\/id_rsa.pub 192.168.200.10\r\n<\/pre>\n

\u6ce8\uff1a\u6267\u884c\u4ee5\u4e0a\u64cd\u4f5c\u65f6\u4f1a\u8981\u6c42\u4f60\u8f93\u5165\u8fdc\u7a0b\u4e3b\u673a\u5e10\u6237\u548c\u5bc6\u7801\uff0c\u7136\u540e\u5c31\u4f1a\u81ea\u52a8\u5c06\u516c\u94a5\u62f7\u8d1d\u81f3\u8fdc\u7a0b\u76ee\u5f55\u3002<\/p>\n

4. \u65e0\u9700\u5bc6\u7801\u901a\u8fc7ssh\u6765\u6267\u884crsync<\/strong><\/div>\n

\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u4e0d\u9700\u8981\u5bc6\u7801\u901a\u8fc7ssh\u8fde\u63a5\u5230\u8fdc\u7a0b\u4e3b\u673a<\/p>\n

ssh 192.168.200.10\r\n<\/pre>\n

\u518d\u6b21\u6267\u884crsync\uff0c\u5b83\u5c06\u4e0d\u518d\u8981\u6c42\u4f60\u8f93\u5165\u5bc6\u7801<\/p>\n

rsync -avz -e ssh \/home\/linuxprobe\/ linuxprobe@192.168.200.10:\/backup\/linuxprobe\/\r\n<\/pre>\n
\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/rsync-password-less-through-ssh.html<\/a>\u7f16\u8f91\uff1a\u70e8\u5b50\uff0c\u5ba1\u6838\u5458\uff1a\u5f20\u5b8f\u5b87<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5728\u6267\u884crsync\u547d\u4ee4\u65f6\u901a\u5e38\u9700\u8981\u6211\u4eec\u8f93\u5165\u5bc6\u7801\u3002\u4f46\u6709\u65f6\u6211\u4eec\u5e76\u4e0d\u5e0c\u671b\u5982\u6b64\uff0c\u90a3\u4e48\u5982\u4f55\u5b9e\u73b0\u65e0\u5bc6\u7801\u6267\u884crsyn […]<\/p>\n","protected":false},"author":317,"featured_media":6458,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-6455","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\/6455","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\/317"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=6455"}],"version-history":[{"count":8,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/6455\/revisions"}],"predecessor-version":[{"id":245803,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/6455\/revisions\/245803"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/6458"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=6455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=6455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=6455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}