{"id":316,"date":"2019-10-09T13:57:26","date_gmt":"2019-10-09T04:57:26","guid":{"rendered":"http:\/\/localhost:8000\/?p=316"},"modified":"2021-01-17T14:01:45","modified_gmt":"2021-01-17T05:01:45","slug":"ssh_exchange_identification-connection-closed-by-remote-host-error","status":"publish","type":"post","link":"http:\/\/localhost:8000\/2019\/10\/ssh_exchange_identification-connection-closed-by-remote-host-error.html","title":{"rendered":"ssh_exchange_identification: Connection closed by remote host \u30a8\u30e9\u30fc\u306e\u5bfe\u51e6"},"content":{"rendered":"
\u3057\u304b\u3057\u3044\u305a\u308c\u3082\u89e3\u6c7a\u306b\u306f\u3064\u306a\u304c\u3089\u305a\u3001\u9014\u65b9\u306b\u304f\u308c\u305f\u79c1\u3092\u6551\u3063\u3066\u304f\u308c\u305f\u306e\u306f\u3001\u4e0a\u53f8\u304b\u3089\u306e<\/p>\n Host test-* \u307f\u305f\u3044\u306a\u5171\u901a\u8a2d\u5b9a\u304c\u5165\u3063\u3066\u307e\u305b\u3093\uff1f\uff1f<\/p>\n<\/blockquote>\n \u3068\u3044\u3046\u30a8\u30b9\u30d1\u30fc\u6307\u6458\u3067\u3057\u305f\u3002\u307e\u3055\u306b\u305d\u306e\u8a2d\u5b9a\u304c\u5165\u3063\u3066\u3044\u307e\u3059\uff01\uff01<\/p>\n \u8e0f\u307f\u53f0\u30b5\u30fc\u30d0\u7d4c\u7531\u3067\u5404\u30b5\u30fc\u30d0\u306bssh\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001 \u3053\u306e\u5171\u901a\u8a2d\u5b9a\u306e\u305f\u3081\u3001 \u306e\u3088\u3046\u306a\u611f\u3058\u3067 \u5bfe\u5fdc\u7b56\u3068\u3057\u3066\u3001\u5358\u7d14\u306b\u8e0f\u307f\u53f0\u30b5\u30fc\u30d0\u3068\u5b9f\u30b5\u30fc\u30d0\u306e\u540d\u524d\u304c\u88ab\u3089\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n \u306a\u304a\u3001\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u3092\u4f7f\u3063\u305f\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u4e0a\u66f8\u304d\u306b\u95a2\u3057\u3066\u306f\u3001ssh_config\u306e \u30de\u30cb\u30e5\u30a2\u30eb<\/a> \u306b\u66f8\u3044\u3066\u3042\u308b\u306e\u3067\u3001\u8a73\u7d30\u306f\u305d\u3061\u3089\u3092\u53c2\u7167\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" ssh_exchange_identification: Connection closed by remote host\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306e\u5bfe\u51e6\u65b9\u6cd5\u3092\u30e1\u30e2\u3063\u3066\u304a\u304d\u307e\u3059\u3002 \u307e\u305a\u3001\u30b0\u30b0\u308b\u3068\u4ee5\u4e0b\u304c\u30d2\u30c3\u30c8\u3057\u305f\u306e\u3067\u3001\u305d\u308c\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002 ~\/.ssh\/known_hosts \u304b\u3089\u95a2\u9023\u3057\u305d\u3046\u306a\u8a2d\u5b9a\u3092\u6d88\u3059 \/etc\/hosts.allow \u306b\u63a5\u7d9a\u5143IP\u30a2\u30c9\u30ec\u30b9\u3092\u8a18\u8f09\u3059\u308b \/etc\/ssh\/sshd_config \u306e MaxStartups \u306e\u8a2d\u5b9a\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306e 10:30:100 \u304b\u3089\u5897\u3084\u3059 host\u540d\u3084ip\u30a2\u30c9\u30ec\u30b9\u304c\u672c\u5f53\u306b\u3042\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3059\u308b \u3057\u304b\u3057\u3044\u305a\u308c\u3082\u89e3\u6c7a\u306b\u306f\u3064\u306a\u304c\u3089\u305a\u3001\u9014\u65b9\u306b\u304f\u308c\u305f\u79c1\u3092\u6551\u3063\u3066\u304f\u308c\u305f\u306e\u306f\u3001\u4e0a\u53f8\u304b\u3089\u306e Host test-* \u307f\u305f\u3044\u306a\u5171\u901a\u8a2d\u5b9a\u304c\u5165\u3063\u3066\u307e\u305b\u3093\uff1f\uff1f \u3068\u3044\u3046\u30a8\u30b9\u30d1\u30fc\u6307\u6458\u3067\u3057\u305f\u3002\u307e\u3055\u306b\u305d\u306e\u8a2d\u5b9a\u304c\u5165\u3063\u3066\u3044\u307e\u3059\uff01\uff01 \u8e0f\u307f\u53f0\u30b5\u30fc\u30d0\u7d4c\u7531\u3067\u5404\u30b5\u30fc\u30d0\u306bssh\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001 <\/span>Continue Reading<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[34],"tags":[],"_links":{"self":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts\/316"}],"collection":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/comments?post=316"}],"version-history":[{"count":1,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts\/316\/revisions"}],"predecessor-version":[{"id":317,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts\/316\/revisions\/317"}],"wp:attachment":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/media?parent=316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/categories?post=316"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/tags?post=316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}ssh_exchange_identification: Connection closed by remote host<\/code>\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306e\u5bfe\u51e6\u65b9\u6cd5\u3092\u30e1\u30e2\u3063\u3066\u304a\u304d\u307e\u3059\u3002
\n\u307e\u305a\u3001\u30b0\u30b0\u308b\u3068\u4ee5\u4e0b\u304c\u30d2\u30c3\u30c8\u3057\u305f\u306e\u3067\u3001\u305d\u308c\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n
\n
~\/.ssh\/config<\/code>\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u3092\u4f7f\u3063\u305f\u5171\u901a\u8a2d\u5b9a\u3092\u884c\u306a\u3063\u3066\u304a\u308a\u3001<\/p>\n
# \u8e0f\u307f\u53f0\nHost test-bastion\n HostName hoge.fuga.net\n User hogeuser\n Port 22222\n ForwardAgent yes\n\n# \u5171\u901a\nHost test-*\n User hogeuser\n ProxyCommand ssh -W %h:%p test-bastion<\/code><\/pre>\n
ssh test-xxx<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001<\/p>\n
Host test-bastion\n HostName hoge.fuga.net\n User hogeuser\n Port 22222\n ForwardAgent yes\n ProxyCommand ssh -W %h:%p test-bastion ## <------<\/code><\/pre>\n
test-bastion<\/code>\u306b
ProxyCommand<\/code>\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u5b58\u5728\u3059\u308b\u3088\u3046\u306b\u89e3\u91c8\u3055\u308c\u3001
test-bastion<\/code>\u306b
test-bastion<\/code>\u7d4c\u7531\u3067\u30a2\u30af\u30bb\u30b9\u3057\u3088\u3046\u3068\u3057\u3066\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3044\u305f\u3088\u3046\u3067\u3059\u3002<\/p>\n
Host bastion-for-test\n HostName hoge.fuga.net\n User hogeuser\n Port 22222\n ForwardAgent yes\n\n# \u5171\u901a\nHost test-*\n User hogeuser\n ProxyCommand ssh -W %h:%p bastion-for-test\n<\/code><\/pre>\n