{"id":151,"date":"2010-01-12T17:07:53","date_gmt":"2010-01-12T16:07:53","guid":{"rendered":"http:\/\/le-moulin-de-verre.com\/fieldnotes\/?p=151"},"modified":"2010-01-12T17:13:22","modified_gmt":"2010-01-12T16:13:22","slug":"authorize-external-connection-to-sshd-from-other-hosts","status":"publish","type":"post","link":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/?p=151","title":{"rendered":"Allow connection sshd from other hosts"},"content":{"rendered":"<p>I set up an SSH server using Cygwin on windows. I was able to test it localy (ssh myAccount@localhost) but I encountered an error when trying from a distant machine.<\/p>\n<pre>\r\nssh_exchange_identification: Connection closed by remote host\r\n<\/pre>\n<p>We have to allow connection from a distant machine inside \/etc\/hosts.allow on the server.<br \/>\nThe syntax of this file is<\/p>\n<pre lang=\"bash\">\r\n<services separated by coma>:<hosts or IP separated by coma>[:command]\r\n<\/pre>\n<p>where command is the command to execute on a connection attempt<\/p>\n<p>So I remove the PARANOID deny from the allow file (!?) and explicitly logged connection attempts from ssh.<\/p>\n<pre  lang=\"bash\">\r\n# hosts.allow   This file describes the names of the hosts which are\r\n#               allowed to use the local INET services, as decided\r\n#               by the '\/usr\/sbin\/tcpd' server.\r\n#\r\nALL : localhost 127.0.0.1\/32 [::1]\/128 : allow\r\nALL : PARANOID : deny\r\nsshd: ALL\r\n<\/pre>\n<pre  lang=\"bash\">\r\n# hosts.allow   This file describes the names of the hosts which are\r\n#               allowed to use the local INET services, as decided\r\n#               by the '\/usr\/sbin\/tcpd' server.\r\n#\r\nALL : localhost 127.0.0.1\/32 [::1]\/128 : allow\r\n# sshd: ALL\r\n# same directive while keeping track of attemps\r\nshd: ALL: spawn (echo \"Attempt from %h %a to %d at `date` by %u\" | tee -a \/var\/log\/sshd.log)\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I set up an SSH server using Cygwin on windows. I was able to test it localy (ssh myAccount@localhost) but I encountered an error when trying from a distant machine. ssh_exchange_identification: Connection closed by remote host We have to allow connection from a distant machine inside \/etc\/hosts.allow on the server. The syntax of this file &hellip; <a href=\"https:\/\/le-moulin-de-verre.com\/fieldnotes\/?p=151\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Allow connection sshd from other hosts&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[1],"tags":[13,19,18],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5WcEf-2r","_links":{"self":[{"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/posts\/151"}],"collection":[{"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=151"}],"version-history":[{"count":14,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/posts\/151\/revisions"}],"predecessor-version":[{"id":164,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/posts\/151\/revisions\/164"}],"wp:attachment":[{"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}