{"id":112,"date":"2011-04-22T17:34:05","date_gmt":"2011-04-22T08:34:05","guid":{"rendered":"http:\/\/daily.belltail.jp\/?p=112"},"modified":"2011-04-22T17:43:21","modified_gmt":"2011-04-22T08:43:21","slug":"ssh%e3%81%ae%e5%85%ac%e9%96%8b%e9%8d%b5%e8%aa%8d%e8%a8%bc%e3%81%ae%e8%a8%ad%e5%ae%9a%e3%81%a7%e3%81%a4%e3%81%be%e3%81%9a%e3%81%84%e3%81%9f","status":"publish","type":"post","link":"https:\/\/daily.belltail.jp\/?p=112","title":{"rendered":"ssh\u306e\u516c\u958b\u9375\u8a8d\u8a3c\u306e\u8a2d\u5b9a\u3067\u3064\u307e\u305a\u3044\u305f"},"content":{"rendered":"<p>belltail.jp\u306f\u3055\u304f\u3089VPS\u3067\u7a3c\u50cd\u3057\u3066\u3066\u3001\u666e\u6bb5\u306fssh\u3067\u7ba1\u7406\u3057\u3066\u307e\u3059\u3002<br \/>\n\u81ea\u5b85\u4ee5\u5916\u306b\u3082\u62e0\u70b9\u304c\u3067\u304d\u305f\u306e\u3067\u3001\u5916\u304b\u3089\u3054\u306b\u3087\u3054\u306b\u3087\u3044\u3058\u308c\u308b\u3088\u3046\u306b\u3057\u305f\u304b\u3063\u305f\u3002<br \/>\n\u3084\u308b\u3053\u3068\u306f\u30ad\u30fc\u3092\u751f\u6210\u3057\u3066authorized_keys\u306b\u8ffd\u52a0\u3059\u308b\u3060\u3051\u306a\u3093\u3060\u3051\u3069\u3002\u306a\u3093\u304b\uff11\u6642\u9593\u304f\u3089\u3044\u683c\u95d8\u3057\u3061\u3083\u3063\u305f\u306e\u3067\u30e1\u30e2\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u3064\u307e\u305a\u3044\u305f\u3001\u3063\u3066\u3044\u3046\u306e\u306f\u3001\u5177\u4f53\u7684\u306b\u306f\u3001\u4e00\u901a\u308a\u8a2d\u5b9a\u3057\u305f\u3068\u601d\u3063\u305f\u306e\u306b\u3001\u5165\u308d\u3046\u3068\u3057\u305f\u3089<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nAgent admitted failure to sign using the key.\r\nPermission denied (publickey).\r\n<\/pre>\n<p>\u3068\u8a00\u308f\u308c\u305f\u3053\u3068\u3002<br \/>\n\u6b21\u306e\u8a2d\u5b9a\u624b\u9806\u3092\u3061\u3083\u3093\u3068\u8e0f\u3093\u3060\u3089\u89e3\u6c7a\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>*\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074<br \/>\n\u6700\u521d\u306f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u4e0a\u3067\u516c\u958b\u9375\u3068\u975e\u516c\u958b\u9375\u306e\u30da\u30a2\u3092\u751f\u6210\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n % ssh-keygen -t rsa\r\n <\/pre>\n<p>\u3067\u3001\u3088\u308d\u3057\u304f\u8a2d\u5b9a\u3002\u4fdd\u5b58\u5148\u306f\u30c7\u30d5\u30a9\u30eb\u30c8(~\/.ssh\/)\u3067\u3044\u3044\u3057\u3001\u30d1\u30b9\u30d5\u30ec\u30fc\u30ba\u306f\u9069\u5207\u306b\u3002\u7a7a\u3067\u3082\u53ef\u3002\u30d1\u30b9\u30ef\u30fc\u30c9\u3068\u306f\u9055\u3046\u3088\u3002\u3067\u3082\u3042\u3068\u3067\u4f7f\u3046\u3088\u3002<\/p>\n<p>\u6b21\u306b\u3001\u751f\u6210\u3055\u308c\u305f~\/.ssh\/id_rsa.pub\u3092\u30b5\u30fc\u30d0\u306b\u8ee2\u9001\u3057\u307e\u3059\u3002<br \/>\n\u4eca\u306f\u307e\u3060\u30b5\u30fc\u30d0\u306esshd\u8a2d\u5b9a\u306f\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u306b\u306a\u3063\u3066\u308b\u306f\u305a\u3067\u3059\u306e\u3067\u3001\u666e\u901a\u306bscp\u306a\u3069\u3067\u9001\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% scp ~\/.ssh\/id_rsa.pub (username)@(hostname):~\/.ssh\/\r\n<\/pre>\n<p>\u9001\u3063\u305f\u3089\u30b5\u30fc\u30d0\u5074\u3067\u5c11\u3057\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u304c\u3044\u3063\u305f\u3093\u304a\u3044\u3068\u3044\u3066\u3002<\/p>\n<p>\u3067\u3001\u3053\u308c\u3092\u3057\u3066\u306a\u304f\u3066\u8e93\u304d\u307e\u304f\u3063\u305f\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% ssh-add ~\/.ssh\/id_rsa\r\n<\/pre>\n<p>\u3053\u3053\u3067\u3055\u3063\u304d\u5165\u529b\u3057\u305f\u30d1\u30b9\u30d5\u30ec\u30fc\u30ba\u3092\u5165\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u306e\u8a2d\u5b9a\u306f\u7d42\u308f\u308a\u3002<\/p>\n<p>*\u30b5\u30fc\u30d0\u5074<br \/>\n\u307e\u305a\u30d0\u30fc\u30c1\u30e3\u30eb\u30b3\u30f3\u30bd\u30fc\u30eb\u306a\u308a\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u3067\u306essh\u306a\u308a\u3067\u30b5\u30fc\u30d0\u5074\u306b\u5165\u308a\u307e\u3059\u3002<br \/>\n\u305d\u308c\u3067\u3001\/etc\/ssh\/sshd_config\u3092\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n<p>ssh\u3067\u30eb\u30fc\u30c8\u306b\u5165\u308c\u308b\u72b6\u614b\u306f\u3042\u3093\u307e\u3057\u3088\u308d\u3057\u304f\u306a\u3044\u3067\u3057\u3087\u3046\u3002<br \/>\n\u306a\u306e\u3067\u3001\u6b21\u306e\u884c\u3092\u5909\u66f4(\u306a\u3051\u308c\u3070\u8ffd\u8a18)\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nPermitRootLogin no\r\n<\/pre>\n<p>\u5165\u308c\u308b\u30e6\u30fc\u30b6\u306f\u57fa\u672c\u7684\u306b\u4e00\u4eba\u3060\u3051\u306b\u3057\u3068\u304f\u3068\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u306a\u306e\u3067\u3001\u6b21\u306e\u884c\u3092\u8ffd\u8a18\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nAllowUsers (username)\r\n<\/pre>\n<p>\u516c\u958b\u9375\u8a8d\u8a3c\u3067\u5165\u308c\u308b\u3088\u3046\u306b\u3057\u3088\u3046\u3063\u3066\u8a71\u306a\u306e\u3067(\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u7684\u306b\u3082\u305d\u308c\u304c\u671b\u307e\u3057\u3044)\u3001\u6b21\u306e\u884c\u3092\u8ffd\u8a18\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nPasswordAuthentication no\r\n<\/pre>\n<p>\u3053\u308c\u3067sshd\u95a2\u9023\u306e\u8a2d\u5b9a\u306fOK\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u3001\u6b21\u306f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u516c\u958b\u9375\u3092\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% cd ~\/.ssh\r\n% cat id_rsa.pub &gt;&gt; authorized_keys\r\n% rm id_rsa.pub\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/\u3082\u3046\u3044\u3089\u306a\u3044\r\n<\/pre>\n<p>\u3053\u306eid_rsa.pub\u304c\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089scp\u3057\u305f\u516c\u958b\u9375\u3067\u3001authorized_keys\u304c\u63a5\u7d9a\u3092\u53d7\u3051\u5165\u308c\u308b\u9375\u306e\u4e00\u89a7\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u8a2d\u5b9a\u304c\u5168\u90e8\u7d42\u308f\u3063\u305f\u306e\u3067\u3001<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# \/etc\/init.d\/ssh restart\r\n<\/pre>\n<p>\u9069\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089ssh\u3092\u5b9f\u884c\u3059\u308b\u3068(\u30d1\u30b9\u30ef\u30fc\u30c9\u306a\u3057\u3067)\u5165\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3068\u3053\u308d\u3067\u3001\u300c\u3064\u307e\u305a\u3044\u305f\u300d\u3067\u3042\u3063\u3066\u300c\u3064\u307e\u3065\u3044\u305f\u300d\u3067\u306f\u7121\u3044\u306e\u3067\u3059\u306d\u2026\u3002\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>belltail.jp\u306f\u3055\u304f\u3089VPS\u3067\u7a3c\u50cd\u3057\u3066\u3066\u3001\u666e\u6bb5\u306fssh\u3067\u7ba1\u7406\u3057\u3066\u307e\u3059\u3002 \u81ea\u5b85\u4ee5\u5916\u306b\u3082\u62e0\u70b9\u304c\u3067\u304d\u305f\u306e\u3067\u3001\u5916\u304b\u3089\u3054\u306b\u3087\u3054\u306b\u3087\u3044\u3058\u308c\u308b\u3088\u3046\u306b\u3057\u305f\u304b\u3063\u305f\u3002 \u3084\u308b\u3053\u3068\u306f\u30ad\u30fc\u3092\u751f\u6210\u3057\u3066authorized_keys\u306b\u8ffd\u52a0\u3059\u308b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[7,8],"class_list":["post-112","post","type-post","status-publish","format-standard","hentry","category-1","tag-linux","tag-8"],"_links":{"self":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/posts\/112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=112"}],"version-history":[{"count":0,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions"}],"wp:attachment":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}