{"id":12,"date":"2009-07-17T02:10:05","date_gmt":"2009-07-16T17:10:05","guid":{"rendered":"http:\/\/lumieir.net\/blog\/?p=12"},"modified":"2009-07-17T02:10:05","modified_gmt":"2009-07-16T17:10:05","slug":"ssh-rsync%e3%81%ae%e8%a8%ad%e5%ae%9a","status":"publish","type":"post","link":"http:\/\/lumieir.net\/blog\/2009\/07\/ssh-rsync%e3%81%ae%e8%a8%ad%e5%ae%9a\/","title":{"rendered":"ssh + rsync\u306e\u8a2d\u5b9a"},"content":{"rendered":"<p>\u30e1\u30e2\u3002<br \/>\n\u30c6\u30b9\u30c8\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u672c\u756a\u30b5\u30fc\u30d0\u30fc\u3078\u306e\u30bd\u30fc\u30b9\u306e\u30a2\u30c3\u30d7\u306a\u3069\u306b\u3088\u304f\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\nlocal to local\u306e\u901a\u4fe1\u306e\u5834\u5408\u306f\u9375\u3082\u3064\u304b\u3063\u3066\u30d1\u30b9\u30ef\u30fc\u30c9\u306a\u3057\u3067\u5feb\u9069\u5ea6\u30a2\u30c3\u30d7\uff01<\/p>\n<h4>\u30b3\u30d4\u30fc\u5143\u30b5\u30fc\u30d0\u30fc\u3067\u306e\u8a2d\u5b9a<\/h4>\n<p><code><strong>ssh\u306e\u516c\u958b\u9375\u4f5c\u6210<\/strong><br \/>\n$ ssh-keygen -t rsa<br \/>\nGenerating public\/private rsa key pair.<br \/>\nEnter file in which to save the key (\/home\/yani\/.ssh\/id_rsa): <span style=\"color: #99cc00;\">\u300cEnter\u300d\u3092\u62bc\u3059<br \/>\n<\/span>Enter passphrase (empty for no passphrase): <span style=\"color: #99cc00;\">\u300cEnter\u300d\u3092\u62bc\u3059<br \/>\n<\/span>Enter same passphrase again: <span style=\"color: #99cc00;\">\u300cEnter\u300d\u3092\u62bc\u3059<br \/>\n<\/span>Your identification has been saved in \/home\/yani\/.ssh\/id_rsa.<br \/>\nYour public key has been saved in \/home\/yani\/.ssh\/id_rsa.pub.<br \/>\nThe key fingerprint is:<br \/>\n0f:d7:be:40:3c:9e:24:38:b6:40:8a:09:8d:c4:18:2b yani@centos52<br \/>\n<strong>\u51fa\u6765\u4e0a\u304c\u308a<\/strong><br \/>\n$ ls -la .ssh<br \/>\ndrwx------ 2 yani users 4096  7\u6708 17 01:53 .<br \/>\ndrwxr-xr-x 4 yani users 4096  7\u6708 14 03:20 ..<br \/>\n-rw------- 1 yani users 1679  7\u6708 17 01:53 id_rsa<br \/>\n-rw-r--r-- 1 yani users  395  7\u6708 17 01:53 id_rsa.pub<br \/>\n-rw-r--r-- 1 yani users  469  7\u6708  9 04:54 known_hosts<\/code><\/p>\n<h4>\u30b3\u30d4\u30fc\u5148\u30b5\u30fc\u30d0\u30fc\u3067\u306e\u8a2d\u5b9a<\/h4>\n<p><code><strong>authorized_keys\u306e\u4f5c\u6210<\/strong><br \/>\n\u203b\u30b3\u30d4\u30fc\u5148\u30b5\u30fc\u30d0\u30fc\u306eUSERHOME\u306b.ssh\u30d5\u30a9\u30eb\u30c0\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306f\u4e00\u65e6ssh\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002\u52dd\u624b\u306b\u4f5c\u6210\u3055\u308c\u308b\u30cf\u30ba\u3002<br \/>\n$ ls -la ~\/.ssh<br \/>\ndrwx------ 2 yani users 4096  7\u6708  9 03:32 .<br \/>\ndrwxr-xr-x 4 yani users 4096  7\u6708 14 03:20 ..<br \/>\n-rw-r--r-- 1 yani users  469  7\u6708  9 04:54 known_hosts<br \/>\n$ cat >> ~\/.ssh\/authorized_keys<br \/>\n<span style=\"color: #99cc00;\">\u30b3\u30d4\u30fc\u5143\u30b5\u30fc\u30d0\u30fc\u3067\u4f5c\u6210\u3057\u305fid_rsa.pub\u306e\u4e2d\u8eab\u3092\u8cbc\u308a\u4ed8\u3051\u308b<\/span><br \/>\n$ chmod 600 ~\/.ssh\/authorized_keys<br \/>\n$ ls -la ~\/.ssh<br \/>\n-rw------- 1 yani users  395  7\u6708 17 02:00 authorized_keys<br \/>\n-rw-r--r-- 1 yani users  469  7\u6708  9 04:54 known_hosts<br \/>\n<\/code><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3067\u3001\u5b9f\u969b\u306brsync\u306f\u3069\u3046\u5b9f\u884c\u3059\u308b\u304b\u3068\u3044\u3046\u3068<br \/>\n<code>rsync -auvz --delete -e ssh ~\/public_html yani@hogeserver:~\/public_html<\/code><br \/>\n\u3068\u306a\u308a\u307e\u3059\u3002rsync\u30b3\u30de\u30f3\u30c9\u5185\u3067\u306ePATH\u6307\u5b9a\u304c\u7d50\u69cb\u30c7\u30ea\u30b1\u30fc\u30c8\u3067\u3001\u672b\u5c3e\u306b\u300c\/(\u30b9\u30e9\u30c3\u30b7\u30e5)\u300d\u3092\u4ed8\u3051\u308b\u4ed8\u3051\u306a\u3044\u3067\u52d5\u304d\u304c\u5909\u308f\u3063\u305f\u308a\u3059\u308b\u306e\u3067\u6ce8\u610f\u3067\u3059\u3002<\/p>\n<h3 class='related_post_title'>\u95a2\u9023\u8a18\u4e8b:<\/h3><ul class='related_post'><li>\u3042\u308a\u307e\u305b\u3093<\/li><\/ul>","protected":false},"excerpt":{"rendered":"<p>\u30e1\u30e2\u3002 \u30c6\u30b9\u30c8\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u672c\u756a\u30b5\u30fc\u30d0\u30fc\u3078\u306e\u30bd\u30fc\u30b9\u306e\u30a2\u30c3\u30d7\u306a\u3069\u306b\u3088\u304f\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002 local to local\u306e\u901a\u4fe1\u306e\u5834\u5408\u306f\u9375\u3082\u3064\u304b\u3063\u3066\u30d1\u30b9\u30ef\u30fc\u30c9\u306a\u3057\u3067\u5feb\u9069\u5ea6\u30a2\u30c3\u30d7\uff01 \u30b3\u30d4\u30fc\u5143\u30b5\u30fc\u30d0\u30fc\u3067\u306e\u8a2d\u5b9a ssh\u306e\u516c\u958b\u9375\u4f5c\u6210 $ s &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"http:\/\/lumieir.net\/blog\/2009\/07\/ssh-rsync%e3%81%ae%e8%a8%ad%e5%ae%9a\/\"> <span class=\"screen-reader-text\">ssh + rsync\u306e\u8a2d\u5b9a<\/span> \u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[7,6],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-linux-tech","category-tech","tag-rsync","tag-ssh"],"_links":{"self":[{"href":"http:\/\/lumieir.net\/blog\/wp-json\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/lumieir.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/lumieir.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/lumieir.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/lumieir.net\/blog\/wp-json\/wp\/v2\/comments?post=12"}],"version-history":[{"count":17,"href":"http:\/\/lumieir.net\/blog\/wp-json\/wp\/v2\/posts\/12\/revisions"}],"predecessor-version":[{"id":29,"href":"http:\/\/lumieir.net\/blog\/wp-json\/wp\/v2\/posts\/12\/revisions\/29"}],"wp:attachment":[{"href":"http:\/\/lumieir.net\/blog\/wp-json\/wp\/v2\/media?parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/lumieir.net\/blog\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/lumieir.net\/blog\/wp-json\/wp\/v2\/tags?post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}