Skip to content

Instantly share code, notes, and snippets.

@abakum
Last active December 3, 2017 14:07
Show Gist options
  • Save abakum/e8b4ed4c1d5d040a886c3324c7635a0a to your computer and use it in GitHub Desktop.
Save abakum/e8b4ed4c1d5d040a886c3324c7635a0a to your computer and use it in GitHub Desktop.
openSSH on Win with RSA authorization for sftp
Protocol 2
StrictModes no
PubkeyAuthentication yes
AuthorizedKeysFile c:\PortableApps\OpenSSH\authorized_keys
PasswordAuthentication no
PermitEmptyPasswords no
UsePAM yes
PidFile sshd.pid
Subsystem sftp sftp-server.exe
@abakum
Copy link
Author

abakum commented Dec 3, 2017

:download from https://github.com/PowerShell/Win32-OpenSSH/releases
:unpack to c:\PortableApps\OpenSSH
cd c:\PortableApps\OpenSSH
:edit sshd_config
.\ssh-keygen -A
.\ssh-keygen -t rsa
:add id_rsa.pub to c:\PortableApps\OpenSSH\authorized_keys
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
.\install-sshd.ps1
.\FixHostFilePermissions.ps1 -Confirm:$false
New-NetFirewallRule -Protocol TCP -LocalPort 22 -Direction Inbound -Action Allow -DisplayName sshd
Set-Service sshd -StartupType Automatic
Start-Service sshd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment