{"id":151,"date":"2018-03-30T00:45:31","date_gmt":"2018-03-29T15:45:31","guid":{"rendered":"http:\/\/www7390uo.sakura.ne.jp\/wordpress\/?p=151"},"modified":"2022-07-17T11:59:05","modified_gmt":"2022-07-17T02:59:05","slug":"ssh%e6%8e%a5%e7%b6%9a%e3%81%8cwrite-failed-broken-pipe%e3%81%a7%e5%88%87%e6%96%ad%e3%81%95%e3%82%8c%e3%82%8b%e3%81%ae%e3%82%92%e9%98%b2%e3%81%90","status":"publish","type":"post","link":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/archives\/151","title":{"rendered":"Write failed: Broken pipe\u306b\u3088\u308b\u5207\u65ad\u3092\u9632\u3050"},"content":{"rendered":"\n<p>\u30b5\u30fc\u30d0\u306bssh\u63a5\u7d9a\u3057\u305f\u3042\u3068\u5207\u65ad\u305b\u305a\u306b\u6368\u3066\u304a\u304f\u3068<code>Write failed: Broken pipe<\/code>\u3068\u3044\u3046\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u3066\u30bb\u30c3\u30b7\u30e7\u30f3\u304c\u5207\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u3042\u3063\u305f\u3002\u518d\u5ea6\u3001\u63a5\u7d9a\u3057\u76f4\u3059\u306e\u306f\u624b\u9593\u3067\u3042\u308b\u304b\u3089ssh\u63a5\u7d9a\u306e\u8a2d\u5b9a\u3092\u63a2\u3063\u3066\u5207\u65ad\u3055\u308c\u306c\u3088\u3046\u306b\u3059\u308b\u3082\u306e\u3067\u3042\u308b\u3002\u4f8b\u3048\u3070\u3053\u3046\u3044\u3046\u5177\u5408\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ vi ~\/.ssh\/config\nHost *\n  ServerAliveInterval 30\n  ServerAliveCountMax 10<\/pre>\n\n\n\n<p><code>ServerAliveInterval<\/code>\u306f\u30b5\u30fc\u30d0\u304b\u3089\u30c7\u30fc\u30bf\u304c\u9001\u3089\u308c\u3066\u3053\u306a\u304f\u306a\u3063\u3066\u304b\u3089\u4f55\u79d2\u5f8c\u306b\u5fdc\u7b54\u3092\u6c42\u3081\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6295\u3052\u3064\u3051\u308b\u304b\u3092\u5b9a\u3081\u308b\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u305d\u3082\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u308a\u51fa\u3055\u306a\u3044\u6a21\u69d8\u3067\u3042\u308b\u3002tcpdump\u3067\u901a\u4fe1\u3092\u8997\u304d\u898b\u308b\u3068\u3001PSH\u30d5\u30e9\u30b0\u3092\u7acb\u3066\u305f\u30d1\u30b1\u30c3\u30c8\u3092\u30b5\u30fc\u30d0\u3078\u9001\u308a\u3064\u3051\u3066\u3044\u308b\u3088\u3046\u3067\u3042\u3063\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo tcpdump -n -i ens3 port 22\n(snip)\n22:50:30.488309 IP 192.0.2.1.55773 &gt; 153.121.51.164.22: Flags [P.], seq 72:108, ack 109, win 305, options [nop,nop,TS val 1047147664 ecr 177098205], length 36\n22:50:30.488696 IP 153.121.51.164.22 &gt; 192.0.2.1.55773: Flags [P.], seq 109:145, ack 108, win 309, options [nop,nop,TS val 177105717 ecr 1047147664], length 36\n22:50:30.506156 IP 192.0.2.1.55773 &gt; 153.121.51.164.22: Flags [.], ack 145, win 305, options [nop,nop,TS val 1047147668 ecr 177105717], length 0\n\n22:51:00.536025 IP 192.0.2.1.55773 &gt; 153.121.51.164.22: Flags [P.], seq 108:144, ack 145, win 305, options [nop,nop,TS val 1047155176 ecr 177105717], length 36\n22:51:00.536334 IP 153.121.51.164.22 &gt; 192.0.2.1.55773: Flags [P.], seq 145:181, ack 144, win 309, options [nop,nop,TS val 177113229 ecr 1047155176], length 36\n22:51:00.554444 IP 192.0.2.1.55773 &gt; 153.121.51.164.22: Flags [.], ack 181, win 305, options [nop,nop,TS val 1047155180 ecr 177113229], length 0<\/pre>\n\n\n\n<p><code>ServerAliveCountMax<\/code>\u306f\u30b5\u30fc\u30d0\u304b\u3089\u306e\u53cd\u5fdc\u304c\u7121\u304f\u306a\u3063\u305f\u969b\u3001\u5fdc\u7b54\u3092\u547c\u3073\u304b\u3051\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u9001\u51fa\u56de\u6570\u5b9a\u3081\u3001\u3053\u308c\u3092\u8d85\u3048\u305f\u3089\u5207\u65ad\u3057\u3066\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u7d42\u3048\u308b\u6a21\u69d8\u3067\u3042\u308b\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f3\u56de\u3068\u3044\u3046\u53d6\u308a\u6c7a\u3081\u3067\u3042\u3063\u305f\u3002\u3057\u305f\u304c\u3063\u3066\u30b5\u30fc\u30d0\u304b\u3089\u306e\u5fdc\u7b54\u304c\u5931\u308f\u308c\u3066\u304b\u3089\u6982\u306d<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ServerAliveInterval \u2715 ServerAliveCountMax<\/pre>\n\n\n\n<p>\u79d2\u7d4c\u904e\u3059\u308b\u3068<code>Timeout, server *** not responding.<\/code>\u3068\u3044\u3046\u30e1\u30c3\u30bb\u30fc\u30b8\u3068\u5171\u306b\u5207\u65ad\u3055\u308c\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2021\/09\/ssh-timeout.gif\"><img loading=\"lazy\" decoding=\"async\" width=\"460\" height=\"314\" src=\"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2021\/09\/ssh-timeout.gif\" alt=\"\" class=\"wp-image-998\"\/><\/a><figcaption>\u56f31. ServerAliveInterval 5, ServerAliveCountMax 1\u306b\u30bb\u30c3\u30c8\u3057\u305f\u5834\u5408\u306e\u6319\u52d5<\/figcaption><\/figure>\n<\/div>\n\n\n<h3 class=\"link\">\u53c2\u8003:<\/h3>\n<ul>\n <li>$ man ssh_config<\/li>\n <li><a href=\"https:\/\/askubuntu.com\/questions\/127369\/how-to-prevent-write-failed-broken-pipe-on-ssh-connection\">How to prevent \u201cWrite Failed: broken pipe\u201d on SSH connection?<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u30b5\u30fc\u30d0\u306bssh\u63a5\u7d9a\u3057\u305f\u3042\u3068\u5207\u65ad\u305b\u305a\u306b\u6368\u3066\u304a\u304f\u3068Write failed: Broken pipe\u3068\u3044\u3046\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u3066\u30bb\u30c3\u30b7\u30e7\u30f3\u304c\u5207\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u3042\u3063\u305f\u3002\u518d\u5ea6\u3001\u63a5\u7d9a\u3057\u76f4\u3059\u306e\u306f\u624b\u9593\u3067\u3042\u308b\u304b\u3089ssh\u63a5\u7d9a\u306e\u8a2d\u5b9a\u3092\u63a2\u3063\u3066\u5207\u65ad\u3055\u308c\u306c\u3088\u3046\u306b\u3059\u308b\u3082\u306e\u3067\u3042\u308b\u3002\u4f8b\u3048\u3070\u3053\u3046\u3044\u3046\u5177\u5408\u3067\u3042\u308b\u3002 $ vi ~\/.ssh\/config Host * ServerAliveInterval 30 ServerAliveC &#8230; <a title=\"Write failed: Broken pipe\u306b\u3088\u308b\u5207\u65ad\u3092\u9632\u3050\" class=\"read-more\" href=\"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/archives\/151\" aria-label=\"Write failed: Broken pipe\u306b\u3088\u308b\u5207\u65ad\u3092\u9632\u3050 \u306b\u3064\u3044\u3066\u3055\u3089\u306b\u8aad\u3080\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[157],"tags":[285],"class_list":["post-151","post","type-post","status-publish","format-standard","hentry","category-linux","tag-ssh"],"views":8323,"_links":{"self":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/posts\/151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":0,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"wp:attachment":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}