{"id":50447,"date":"2023-04-10T08:06:30","date_gmt":"2023-04-10T07:06:30","guid":{"rendered":"https:\/\/ekiwi-blog.de\/50447\/set-up-ssh-server-under-windows\/"},"modified":"2023-04-15T21:52:50","modified_gmt":"2023-04-15T20:52:50","slug":"set-up-ssh-server-under-windows","status":"publish","type":"post","link":"https:\/\/ekiwi-blog.de\/en\/50447\/set-up-ssh-server-under-windows\/","title":{"rendered":"Set up SSH server under Windows"},"content":{"rendered":"<p>There are a number of useful use cases for installing and running an <abbr title=\"Secure Shell or Secure Socket Shell\">SSH<\/abbr> server on a Windows system. For example, an SSH server grants secure remote maintenance access at the console level. One can then dial in with an SSH client on the server system in question. Then, provided the permissions allow it, one moves around the target system like an administrator. Another less widespread method is to establish a <a title=\"setup RDP by tunneling via SSH without using VPN\" href=\"https:\/\/ekiwi-blog.de\/en\/50644\/rdp-tunnelling-with-ssh\/\">remote desktop connection (RDP) via SSH<\/a>.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of content<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ekiwi-blog.de\/en\/50447\/set-up-ssh-server-under-windows\/#What_is_SSH\" >What is SSH?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ekiwi-blog.de\/en\/50447\/set-up-ssh-server-under-windows\/#Installing_an_OpenSSH_server_in_Windows\" >Installing an OpenSSH server in Windows<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ekiwi-blog.de\/en\/50447\/set-up-ssh-server-under-windows\/#Add_as_optional_feature\" >Add as optional feature<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ekiwi-blog.de\/en\/50447\/set-up-ssh-server-under-windows\/#Configure_SSH_server_under_%E2%80%9CServices%E2%80%9D\" >Configure SSH server under &#8220;Services&#8221;<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ekiwi-blog.de\/en\/50447\/set-up-ssh-server-under-windows\/#Accessing_the_Windows_system_via_OpenSSH_server\" >Accessing the Windows system via OpenSSH server<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ekiwi-blog.de\/en\/50447\/set-up-ssh-server-under-windows\/#Firewall_rules_and_router_rules\" >Firewall rules and router rules<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"What_is_SSH\"><\/span>What is SSH?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><u>Quite briefly:<\/u> SSH is the acronym for <span class=\"ILfuVd\" lang=\"en\"><span class=\"hgKElc\">Secure Shell or Secure Socket Shell. This is a secure network protocol that is primarily intended to enable network administrators to connect to the computers and servers concerned from outside and then carry out administrative and configurational work. The protocol includes various services as well as security measures (encryption\/authentication etc.) to establish a secure connection. Thus, it is also often used as a replacement for FTP in the form of SFTP (Secure FTP) for file exchange.<\/span><\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Installing_an_OpenSSH_server_in_Windows\"><\/span>Installing an OpenSSH server in Windows<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Add_as_optional_feature\"><\/span>Add as optional feature<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To set up the <a title=\"Start SSH server with PowerShell (Windows)\" href=\"https:\/\/ekiwi-blog.de\/en\/50830\/start-ssh-server-with-powershell-windows\/\">SSH server in Windows<\/a>, the first thing to do is to add <strong>OpenSSH Server<\/strong> as an optional feature. To do this, proceed as follows and shown in the screenshots below:<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Open Windows <strong>&#8220;Settings&#8221;<\/strong> (via the Windows menu or right-click on the Windows menu)<\/li>\n<li>Select &#8220;Apps&#8221; and click <strong>&#8220;Optional Features&#8221;<\/strong><\/li>\n<li>&#8220;Add optional features&#8221; button and <strong>&#8220;View features&#8221; button<\/strong><\/li>\n<li>Scroll to <strong>&#8220;OpenSSH Server&#8221;<\/strong> or enter term in search box and then select and click <strong>&#8220;Next&#8221;<\/strong>.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<figure id=\"attachment_50434\" aria-describedby=\"caption-attachment-50434\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-50434\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/run-ssh-server-windows-optional-features.jpg\" alt=\"in Windows Settings select Apps and Optional Features and then click View Features button\" width=\"650\" height=\"397\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/run-ssh-server-windows-optional-features.jpg 650w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/run-ssh-server-windows-optional-features-300x183.jpg 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><figcaption id=\"caption-attachment-50434\" class=\"wp-caption-text\">Add optional features via settings<\/figcaption><\/figure>\n<ol>\n<li style=\"list-style-type: none;\"><\/li>\n<\/ol>\n<ol>\n<li style=\"list-style-type: none;\"><\/li>\n<\/ol>\n<figure id=\"attachment_50414\" aria-describedby=\"caption-attachment-50414\" style=\"width: 382px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-50414\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/add-open-ssh-server-for-windows.jpg\" alt=\"Install OpenSSH server as an optional feature\" width=\"382\" height=\"500\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/add-open-ssh-server-for-windows.jpg 382w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/add-open-ssh-server-for-windows-229x300.jpg 229w\" sizes=\"auto, (max-width: 382px) 100vw, 382px\" \/><figcaption id=\"caption-attachment-50414\" class=\"wp-caption-text\">Select OpenSSH server and click &#8220;Next<\/figcaption><\/figure>\n<p>The download and installation process of the SSH server will then begin. If this has been completed successfully, the OpenSSH server will appear in the list &#8220;<em>Installed Features<\/em>&#8220;.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Configure_SSH_server_under_%E2%80%9CServices%E2%80%9D\"><\/span>Configure SSH server under &#8220;Services&#8221;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Depending on how you want to use the SSH server, you will need to make other settings and configurations. By default, the SSH server is set so that it must be started manually. If you want the server to start automatically at every system start, you can configure this under &#8220;<em>Services<\/em>&#8220;.<\/p>\n<figure id=\"attachment_50430\" aria-describedby=\"caption-attachment-50430\" style=\"width: 351px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-50430\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/run-services-via-windows-search.jpg\" alt=\"Screenshot Windows Search Services\" width=\"351\" height=\"227\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/run-services-via-windows-search.jpg 351w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/run-services-via-windows-search-300x194.jpg 300w\" sizes=\"auto, (max-width: 351px) 100vw, 351px\" \/><figcaption id=\"caption-attachment-50430\" class=\"wp-caption-text\">Windows search &#8220;<em>Services<\/em>&#8221; enter and then open<\/figcaption><\/figure>\n<p>In the Windows menu, simply type <strong>&#8220;Services&#8221;<\/strong> and then click on the <strong>Services app<\/strong>.<\/p>\n<p>Then select <strong>&#8220;<em>OpenSSH SSH Server<\/em>&#8221; from the available services and click on it<\/strong>.<\/p>\n<figure id=\"attachment_50438\" aria-describedby=\"caption-attachment-50438\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-50438\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/services-manual-or-automatic-start-ssh-server-with-windows.jpg\" alt=\"Open Windows services and configure OpenSSH startup type (manual, automatic, delayed or disabled).\" width=\"650\" height=\"454\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/services-manual-or-automatic-start-ssh-server-with-windows.jpg 650w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/services-manual-or-automatic-start-ssh-server-with-windows-300x210.jpg 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><figcaption id=\"caption-attachment-50438\" class=\"wp-caption-text\">start SSH server automatically or manually as needed<\/figcaption><\/figure>\n<p>Now you can select &#8220;<em>Automatic<\/em>&#8221; for <strong>Start type<\/strong>. The server will then always start automatically when the computer is restarted. Further options for controlling the SSH server are available via the buttons under &#8220;<em>Service status<\/em>&#8221; (&#8220;<em>Start<\/em>&#8220;, &#8220;<em>Stop<\/em>&#8220;, &#8220;<em>Pause<\/em>&#8220;, &#8220;<em>Resume<\/em>&#8220;) or by <a href=\"https:\/\/ekiwi-blog.de\/en\/50830\/start-ssh-server-with-powershell-windows\/\">starting the SSH server with the Powershell<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Accessing_the_Windows_system_via_OpenSSH_server\"><\/span>Accessing the Windows system via OpenSSH server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Accessing the system from outside via SSH can then be done with any SSH client, such as <em>PuTTY<\/em>, <em>OpenSSH client<\/em>, <em>MobaXterm<\/em>. It can also be done quite easily via the <em>PowerShell<\/em> of Windows. There, as shown in the following screenshot, simply enter the <strong>command ssh<\/strong> followed by the IP or domain name of the target computer:<\/p>\n<pre><code><span style=\"color: #339966;\">ssh<\/span> your.computer.de<\/code><\/pre>\n<figure id=\"attachment_50405\" aria-describedby=\"caption-attachment-50405\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-50405\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/zugriff-auf-windows-ssh-server-mit-powershell.jpg\" alt=\"Open PowerShell and establish an SSH connection to the Windows SSH server\" width=\"650\" height=\"346\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/zugriff-auf-windows-ssh-server-mit-powershell.jpg 650w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2023\/04\/zugriff-auf-windows-ssh-server-mit-powershell-300x160.jpg 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><figcaption id=\"caption-attachment-50405\" class=\"wp-caption-text\">connect to SSH server <a title=\"WindowsApps: Setting up access via Powershell\" href=\"https:\/\/ekiwi-blog.de\/en\/26839\/windowsapps-setting-up-access-via-powershell\/\">via PowerShell<\/a><\/figcaption><\/figure>\n<p>You can see that in the case of this example here, the trustworthiness of the key is still criticised. In a known environment, you can accept this and continue. In larger professional environments, public key authentication should be introduced.<\/p>\n<p>The next step is to ask for the password. This password corresponds to the user account password of the Windows computer on which the SSH server is running.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Firewall_rules_and_router_rules\"><\/span>Firewall rules and router rules<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Depending on from where, from inside or from outside the network, the firewall and\/or router rules must be adjusted.<\/p>\n<p>The SSH protocol uses <strong>port 22<\/strong> by default and is based on <strong>TCP<\/strong>. This must be configured accordingly for incoming connections in the firewall or a router, such as the <a title=\"Timeout during PPP negotiation\" href=\"https:\/\/ekiwi-blog.de\/en\/26493\/timeout-during-ppp-negotiation\/\">Fritz!Box<\/a>.<\/p>\n<p>There should be no problems with the Windows firewall, which should already accept these incoming connections by default. If you still have problems establishing a connection, you should also check the settings there and allow port 22 for incoming connections. The <a title=\"Windows: Allow ping in Windows firewall\" href=\"https:\/\/ekiwi-blog.de\/en\/18584\/windows-allow-ping-in-windows-firewall\/\">Windows firewall<\/a> can be found under &#8220;Settings&#8221; &gt; &#8220;Privacy and Security&#8221; &gt; &#8220;Windows Security&#8221; &gt; &#8220;Firewall and Network Protection&#8221; &gt; &#8220;Advanced Settings&#8221; or simply type in &#8220;Defender&#8221; in the Windows search menu.<\/p>","protected":false},"excerpt":{"rendered":"<p>There are a number of useful use cases for installing and running an SSH server on a Windows system. For<\/p>\n","protected":false},"author":2,"featured_media":13737,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1555],"tags":[2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2068],"class_list":["post-50447","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-en","tag-client-en","tag-ftp-en","tag-openssh-en","tag-secure-en","tag-secure-shell-en","tag-server-en","tag-sftp-en","tag-shell-en","tag-ssh-en","tag-window-en","tag-windows-en-2"],"_links":{"self":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/50447","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/comments?post=50447"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/50447\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media\/13737"}],"wp:attachment":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media?parent=50447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/categories?post=50447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/tags?post=50447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}