{"id":1444,"date":"2022-01-03T20:12:14","date_gmt":"2022-01-03T20:12:14","guid":{"rendered":"https:\/\/howden.net.au\/thowden\/?p=1444"},"modified":"2022-01-18T23:17:33","modified_gmt":"2022-01-18T23:17:33","slug":"configure-openssh-sftp-on-windows-2019","status":"publish","type":"post","link":"https:\/\/howden.net.au\/thowden\/2022\/01\/configure-openssh-sftp-on-windows-2019\/","title":{"rendered":"Configure OpenSSH SFTP on Windows 2019"},"content":{"rendered":"\n<p>Now that I have OpenSSH installed, the next step(s) is(are) to Configure OpenSSH SFTP on Windows 2019. <\/p>\n\n\n\n<p>In my case, I had <a href=\"\/thowden\/2022\/01\/windows-server-2019-openssh-installation\/\" target=\"_blank\" rel=\"noreferrer noopener\">errors during the install<\/a>, but I now have it installed and I am following the default configuration commands from <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows-server\/administration\/openssh\/openssh_install_firstuse\" target=\"_blank\" rel=\"noreferrer noopener\">Microsoft&#8217;s documentation<\/a>.<\/p>\n\n\n\n<p>First up I confirmed the OpenSSH Client and Server are installed:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">PS C:\\windows\\system32> Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'\n\nName  : OpenSSH.Client~~~~0.0.1.0\nState : Installed\n\nName  : OpenSSH.Server~~~~0.0.1.0\nState : Installed<\/pre>\n\n\n\n<p>and then I start \/ install the server as a service:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">PS C:\\windows\\system32> Start-Service sshd\nPS C:\\windows\\system32> Set-Service -Name sshd -StartupType 'Automatic'\nPS C:\\windows\\system32> Set-Service -Name sshd -StartupType 'Automatic'\nPS C:\\windows\\system32> if (!(Get-NetFirewallRule -Name \"OpenSSH-Server-In-TCP\" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) {\n>>     Write-Output \"Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it...\"\n>>     New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22\n>> } else {\n>>     Write-Output \"Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists.\"\n>> }\nFirewall rule 'OpenSSH-Server-In-TCP' has been created and exists.\nPS C:\\windows\\system32><\/pre>\n\n\n\n<p>Ok, so that is the first couple of steps, done via copy\/paste from the MS instructions. Although I do want to come back to the use of Port 22 as the default. I&#8217;ll also need to adjust the ports on the hardware firewall to allow for external SFTP access, but that can come later. <\/p>\n\n\n\n<p>A quick test using PowerShell on my local Windows 10 machine shows that a connection to the server will complete as described, so far success!<\/p>\n\n\n\n<p>Changing the ports took a bit more than I hoped so I documented <a href=\"\/thowden\/2022\/01\/change-the-port-for-openssh-on-windows-2019\/\">Changing the SSH Port<\/a> as well. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that I have OpenSSH installed, the next step(s) is(are) to Configure OpenSSH SFTP on Windows 2019. In my case, I had errors during the install, but I now have it installed and I am following the default configuration commands from Microsoft&#8217;s documentation. First up I confirmed the OpenSSH Client and Server are installed: and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[127,22],"tags":[],"class_list":["post-1444","post","type-post","status-publish","format-standard","hentry","category-openssh","category-windows-servers"],"_links":{"self":[{"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/posts\/1444","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/comments?post=1444"}],"version-history":[{"count":10,"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/posts\/1444\/revisions"}],"predecessor-version":[{"id":1458,"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/posts\/1444\/revisions\/1458"}],"wp:attachment":[{"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/media?parent=1444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/categories?post=1444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/tags?post=1444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}