{"id":87,"date":"2017-06-04T10:17:14","date_gmt":"2017-06-04T00:17:14","guid":{"rendered":"http:\/\/kswp01.azurewebsites.net\/?p=87"},"modified":"2019-08-18T18:59:25","modified_gmt":"2019-08-18T08:59:25","slug":"steps-to-install-and-configure-sftp-ssh-file-transfer-protocol-on-windows-2012-r2-server","status":"publish","type":"post","link":"http:\/\/kswp01.azurewebsites.net\/?p=87","title":{"rendered":"Configure SFTP (SSH File Transfer Protocol) on Windows 2012 R2 Server"},"content":{"rendered":"<h3>Steps to install and configure SFTP (SSH File Transfer Protocol) on Windows 2012 R2 Server<\/h3>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<h5><span style=\"color: #ff0000;\">Caution! : This guide is for a proof of concept only. The steps below give access to the entire server through SFTP. Please mind of security.<\/span><\/h5>\n<p>1. Download&nbsp;v0.0.13.0 \/ OpenSSH-Win64.zip from&nbsp;<a href=\"https:\/\/github.com\/PowerShell\/Win32-OpenSSH\/releases\/\" target=\"_blank\" rel=\"noopener noreferrer\">OpenSSH for Windows binaries<\/a><br \/>\nNote:&nbsp;v0.0.15.0 does not work with the following steps.<\/p>\n<p>2. Extract the package to C:\\Program Files\\OpenSSH<\/p>\n<p>3. As the Administrator, install SSHD and ssh-agent services:<\/p>\n<pre>powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1<\/pre>\n<p>4. As the Administrator, generate server keys by running the following commands from the &#8220;C:\\Program Files\\OpenSSH&#8221;<\/p>\n<pre>.\\ssh-keygen.exe -A<\/pre>\n<p>5. Open a port for the SSH server in Windows Firewall:<br \/>\nRun the following PowerShell command as the Administrator:<\/p>\n<pre>New-NetFirewallRule -Protocol TCP -LocalPort 22 -Direction Inbound -Action Allow -DisplayName SSH<\/pre>\n<p>Also open a port for SSH on your firewall.<\/p>\n<p>6. Start the service and\/or configure automatic start:<br \/>\n<a href=\"\/wp-content\/uploads\/2017\/06\/2015.png\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-95\" src=\"\/wp-content\/uploads\/2017\/06\/2015.png\" alt=\"\" width=\"826\" height=\"936\"><\/a><\/p>\n<p>7. Create the .ssh folder (for the authorized_keys file) in your Windows account profile folder (typically in C:\\Users\\username\\.ssh).<br \/>\nUse the command below as Explore does not like the folder name.<\/p>\n<pre>mkdir .ssh<\/pre>\n<p>8. Grant the SSH server read permissions to the .ssh folder. As the Administrator, run:<\/p>\n<pre>icacls C:\\users\\username\\.ssh \/grant \"NT Service\\sshd:R\" \/T<\/pre>\n<p>9. As the Administrator, find out fingerprint of the server\u2019s ED25519 key by running the following command from the C:\\Program Files\\OpenSSH:<\/p>\n<pre>.\\ssh-keygen.exe -l -f ssh_host_ed25519_key -E md5<\/pre>\n<p>10. Restart the server<\/p>\n<p>&nbsp;<\/p>\n<p>Reference :&nbsp;<a href=\"https:\/\/winscp.net\/eng\/docs\/guide_windows_openssh_server\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/winscp.net\/eng\/docs\/guide_windows_openssh_server<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Steps to install and configure SFTP (SSH File Transfer Protocol) on Windows 2012 R2 Server<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,6],"tags":[],"_links":{"self":[{"href":"http:\/\/kswp01.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/posts\/87"}],"collection":[{"href":"http:\/\/kswp01.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/kswp01.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/kswp01.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/kswp01.azurewebsites.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=87"}],"version-history":[{"count":22,"href":"http:\/\/kswp01.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/posts\/87\/revisions"}],"predecessor-version":[{"id":281,"href":"http:\/\/kswp01.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/posts\/87\/revisions\/281"}],"wp:attachment":[{"href":"http:\/\/kswp01.azurewebsites.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/kswp01.azurewebsites.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/kswp01.azurewebsites.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}