{"id":17267,"date":"2015-04-16T08:00:16","date_gmt":"2015-04-15T23:00:16","guid":{"rendered":"http:\/\/www.sssg.org\/blogs\/hiro345\/?p=17267"},"modified":"2015-04-15T05:51:57","modified_gmt":"2015-04-14T20:51:57","slug":"%e5%a4%9a%e6%ae%b5ssh%e6%8e%a5%e7%b6%9a","status":"publish","type":"post","link":"https:\/\/www.hiro345.net\/blogs\/hiro345\/archives\/17267.html","title":{"rendered":"\u591a\u6bb5SSH\u63a5\u7d9a"},"content":{"rendered":"<p>SSH\u30b5\u30fc\u30d0\u3092\u8907\u6570\u7d4c\u7531\u3055\u305b\u308b\u3053\u3068\u3067\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ec\u30d9\u30eb\u3092\u9ad8\u3081\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u79d8\u5bc6\u9375\u306f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30de\u30b7\u30f3\u306b\u9650\u5b9a\u3057\u3066\u3001\u9593\u306e\u30de\u30b7\u30f3\u306b\u306f\u516c\u958b\u9375\u3057\u304b\u304a\u304b\u305a\u3001\u79d8\u5bc6\u9375\u3092\u6301\u305f\u306a\u3044\u30de\u30b7\u30f3\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u306f\u3067\u304d\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u306e\u3068\u3001\u9593\u306e\u30de\u30b7\u30f3\u3067\u306fIP\u5236\u9650\u3092\u8ffd\u52a0\u3059\u308b\u306a\u3069\u3057\u3066\u3001\u9632\u5fa1\u58c1\u3092\u91cd\u306d\u308b\u308f\u3051\u3067\u3059\u3002<br \/>\n<!--more--><br \/>\n\u6700\u521d\u306bSSH\u30ed\u30b0\u30a4\u30f3\u304c\u5fc5\u8981\u306a\u30de\u30b7\u30f3\u3092SSH\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u3068\u547c\u3076\u3053\u3068\u306b\u3057\u307e\u3057\u3087\u3046\u3002\u57fa\u672c\u306f\u3001SSH\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u7d4c\u7531\u3067\u4f5c\u696d\u5bfe\u8c61\u306eSSH\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3059\u308b\u306b\u306f\u3001SSH\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u3078SSH\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u304b\u3089\u3001\u3055\u3089\u306b\u4f5c\u696d\u5bfe\u8c61\u306eSSH\u30b5\u30fc\u30d0\u30fc\u3078SSH\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; gutter: true\">\r\nlocalhost$ ssh ssh_gateway\r\nssh_gateway$ ssh target_host\r\ntarget_host$\r\n<\/pre>\n<p>\u3053\u306e\u63a5\u7d9a\u65b9\u6cd5\u306f\u9762\u5012\u3067\u3059\u306d\u3002\u3057\u304b\u3082SSH\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u306b\u79d8\u5bc6\u9375\u3092\u7f6e\u304f\u5fc5\u8981\u304c\u3067\u3066\u304d\u307e\u3059\u3002ssh_config\u3092\u4f7f\u3046\u3068\u3001\u3082\u3063\u3068\u624b\u8efd\u306b\u4f5c\u696d\u5bfe\u8c61\u306eSSH\u30b5\u30fc\u30d0\u30fc\u3078\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002Linux\u3060\u3068\u57fa\u672c\u8a2d\u5b9a\u306f\/etc\/ssh\/ssh_config\u306b\u3042\u308a\u307e\u3059\u3002\u30a2\u30ab\u30a6\u30f3\u30c8\u5c02\u7528\u306e\u8a2d\u5b9a\u306f$HOME\/.ssh\/config\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; gutter: true\">\r\nHost ssh_gateway\r\n\r\nHost target_host\r\n  ProxyCommand ssh -W %h:%p ssh_gateway\r\n<\/pre>\n<p>\u3053\u308c\u3067\u3001target_host\u3078\u76f4\u63a5SSH\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; gutter: true\">\r\nlocalhost$ ssh target_host\r\ntarget_host$\r\n<\/pre>\n<p>\u3055\u3089\u306b\u591a\u6bb5\u306b\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u3066\u3001ssh_gateway\u2192target_host\u2192target_host2\u3068\u3044\u3046\u3088\u3046\u306b\u8907\u6570\u306eSSH\u30b5\u30fc\u30d0\u30fc\u3092\u7d4c\u7531\u3059\u308b\u8a2d\u5b9a\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; gutter: true\">\r\nHost ssh_gateway\r\n\r\nHost target_host\r\n  ProxyCommand ssh -W %h:%p ssh_gateway\r\n\r\nHost target_host2\r\n  ProxyCommand ssh -W %h:%p ssh_target_host\r\n<\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001ssh-agent\u3092\u4f7f\u3046\u3068\u30d1\u30b9\u30d5\u30ec\u30fc\u30ba\u306e\u5165\u529b\u3082\u7701\u7565\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002CentOS\u3084Ubuntu\u3067\u306f\u81ea\u52d5\u8d77\u52d5\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u6b21\u306e\u3088\u3046\u306b\u30b3\u30f3\u30bd\u30fc\u30eb\u3067\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: bash; gutter: true\">\r\n$ eval `\/usr\/bin\/ssh-agent`\r\n<\/pre>\n<p>\u79d8\u5bc6\u9375\u3092\u767b\u9332\u3057\u307e\u3059\u3002\u79d8\u5bc6\u9375\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u306f\u4f7f\u3063\u3066\u3044\u308b\u3082\u306e\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u3068\u304d\u30d1\u30b9\u30d5\u30ec\u30fc\u30ba\u3092\u5165\u529b\u3059\u308b\u3068ssh-agent\u304c\u899a\u3048\u3066\u304f\u308c\u3066\u3001\u6b21\u56de\u4ee5\u964d\u306fssh-agent\u304c\u4ee3\u308f\u308a\u306b\u30d1\u30b9\u30d5\u30ec\u30fc\u30ba\u306e\u63d0\u4f9b\u3092\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; gutter: true\">\r\n$ ssh-add ~\/.ssh\/id_rsa\r\n<\/pre>\n<p>\u5f8c\u306f\u666e\u901a\u306bSSH\u30ed\u30b0\u30a4\u30f3\u3092\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<pre class=\"brush: bash; gutter: true\">\r\n$ ssh target_host\r\n<\/pre>\n<p>OpenSSH\u306b\u3064\u3044\u3066\u306f\u4e0b\u8a18\u304c\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<div>\n<iframe loading=\"lazy\" style=\"width: 120px; height: 240px;\" src=\"\/\/rcm-jp.amazon.co.jp\/e\/cm?t=hiro345-22&amp;o=9&amp;p=8&amp;l=as1&amp;asins=4774168076&amp;ref=tf_til&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr\" height=\"240\" width=\"320\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><iframe loading=\"lazy\" style=\"width: 120px; height: 240px;\" src=\"\/\/rcm-jp.amazon.co.jp\/e\/cm?t=hiro345-22&amp;o=9&amp;p=8&amp;l=as1&amp;asins=4873112877&amp;ref=tf_til&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr\" height=\"240\" width=\"320\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div>\n<ul>\n<li><a type=\"amzn\" asin=\"4774168076\">OpenSSH[\u5b9f\u8df5]\u5165\u9580 (Software Design plus)<\/a><\/li>\n<li><a type=\"amzn\" asin=\"4873112877\">\u5b9f\u7528SSH \u7b2c2\u7248\u2015\u30bb\u30ad\u30e5\u30a2\u30b7\u30a7\u30eb\u5fb9\u5e95\u6d3b\u7528\u30ac\u30a4\u30c9 <\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>SSH\u30b5\u30fc\u30d0\u3092\u8907\u6570\u7d4c\u7531\u3055\u305b\u308b\u3053\u3068\u3067\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ec\u30d9\u30eb\u3092\u9ad8\u3081\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u79d8\u5bc6\u9375\u306f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30de\u30b7\u30f3\u306b\u9650\u5b9a\u3057\u3066\u3001\u9593\u306e\u30de\u30b7\u30f3\u306b\u306f\u516c\u958b\u9375\u3057\u304b\u304a\u304b\u305a\u3001\u79d8\u5bc6\u9375\u3092\u6301\u305f\u306a\u3044\u30de\u30b7\u30f3\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u306f\u3067\u304d\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u306e\u3068\u3001\u9593\u306e\u30de\u30b7\u30f3\u3067 &hellip; <a href=\"https:\/\/www.hiro345.net\/blogs\/hiro345\/archives\/17267.html\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[1209,520,198],"class_list":["post-17267","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux","tag-openssh","tag-ssh"],"_links":{"self":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/17267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/comments?post=17267"}],"version-history":[{"count":3,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/17267\/revisions"}],"predecessor-version":[{"id":17336,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/17267\/revisions\/17336"}],"wp:attachment":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/media?parent=17267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/categories?post=17267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/tags?post=17267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}