{"id":1699,"date":"2022-04-07T16:29:25","date_gmt":"2022-04-07T16:29:25","guid":{"rendered":"https:\/\/wphost.spider-e.com\/?p=1699"},"modified":"2022-04-07T16:32:23","modified_gmt":"2022-04-07T16:32:23","slug":"ssh-sessions-over-starlink-connections","status":"publish","type":"post","link":"https:\/\/wphost.spider-e.com\/?p=1699","title":{"rendered":"SSH sessions over Starlink connections"},"content":{"rendered":"\n<p>After I moved my broadband package from a traditional ISP-over-copper to the Satellite based Starlink service, I noticed that my SSH sessions to remote servers would suffer from broken pipes and disconnections far more often than I&#8217;d experienced before. Initially I though this was due to short drop-outs while my Starlink terminal hopped from one satellite to another, but it turned out to be something more interesting. The fix was quick and simple.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>The cause of the dropouts was the Starlink router&#8217;s more aggressive killing of idle connections which it believed to be dead. If I left my SSH session at a prompt for about 5 mintes it would get disconnected.<\/p>\n\n\n\n<p>The solution was to edit the local SSH config on my client machine to send keep-alive packets when the session is idle. I made a corresponding change to the ssh daemon running on my hosted server too. <\/p>\n\n\n\n<p>Here&#8217;s the details.<\/p>\n\n\n\n<p>One the server (in my case Ubuntu 18.04) I edited \/etc\/ssh\/sshd_config to include the following two lines:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/i0.wp.com\/wphost.spider-e.com\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-07-at-17.24.37.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"468\" height=\"62\" src=\"https:\/\/i0.wp.com\/wphost.spider-e.com\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-07-at-17.24.37.png?resize=468%2C62&#038;ssl=1\" alt=\"\" class=\"wp-image-1700\" srcset=\"https:\/\/i0.wp.com\/wphost.spider-e.com\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-07-at-17.24.37.png?w=468&amp;ssl=1 468w, https:\/\/i0.wp.com\/wphost.spider-e.com\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-07-at-17.24.37.png?resize=300%2C40&amp;ssl=1 300w\" sizes=\"auto, (max-width: 468px) 100vw, 468px\" \/><\/a><figcaption>Lines added to \/etc\/ssh\/sshd_config<\/figcaption><\/figure><\/div>\n\n\n\n<p>And on my client, (macOS 12.3) I edited ~\/.ssh\/ssh_config to contain the following lines:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/i0.wp.com\/wphost.spider-e.com\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-07-at-14.54.25.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"406\" height=\"114\" src=\"https:\/\/i0.wp.com\/wphost.spider-e.com\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-07-at-14.54.25.png?resize=406%2C114\" alt=\"\" class=\"wp-image-1698\" srcset=\"https:\/\/i0.wp.com\/wphost.spider-e.com\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-07-at-14.54.25.png?w=406&amp;ssl=1 406w, https:\/\/i0.wp.com\/wphost.spider-e.com\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-07-at-14.54.25.png?resize=300%2C84&amp;ssl=1 300w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><\/a><figcaption>Contets of ~\/.ssh\/config<\/figcaption><\/figure><\/div>\n\n\n\n<p>Both of these changes do similar things &#8211; they cause the client (and server) to send keep-alive packets if the connection is idle for more than the specified interval (in seconds). <\/p>\n\n\n\n<p>Now I can keep my sessions alive indefintely and the problem with broken pipes and disconnections has gone away.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>After I moved my broadband package from a traditional ISP-over-copper to the Satellite based Starlink service, I noticed that my SSH sessions to remote servers would suffer from broken pipes and disconnections far more often than I&#8217;d experienced before. Initially I though this was due to short drop-outs while my Starlink terminal hopped from one [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4],"tags":[11,109,111,110],"class_list":["post-1699","post","type-post","status-publish","format-standard","hentry","category-general","tag-mac-2","tag-ssh","tag-starlink","tag-ubuntu"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p42WEU-rp","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/wphost.spider-e.com\/index.php?rest_route=\/wp\/v2\/posts\/1699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wphost.spider-e.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wphost.spider-e.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wphost.spider-e.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wphost.spider-e.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1699"}],"version-history":[{"count":3,"href":"https:\/\/wphost.spider-e.com\/index.php?rest_route=\/wp\/v2\/posts\/1699\/revisions"}],"predecessor-version":[{"id":1703,"href":"https:\/\/wphost.spider-e.com\/index.php?rest_route=\/wp\/v2\/posts\/1699\/revisions\/1703"}],"wp:attachment":[{"href":"https:\/\/wphost.spider-e.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wphost.spider-e.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wphost.spider-e.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}