Skip to content

Instantly share code, notes, and snippets.

@edcote
Last active January 19, 2018 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edcote/abf0d4261fc2b35fe18aa5bd5ecfd849 to your computer and use it in GitHub Desktop.
Save edcote/abf0d4261fc2b35fe18aa5bd5ecfd849 to your computer and use it in GitHub Desktop.
Windows 10 OpenSSH Configuration

Win10 OpenSSH Tips

Don't ask. I dislike Windows.

  • Recursively take ownership administrator group

    TAKEOWN /F "C:\WINDOWS\System32\OpenSSH" /R TAKEOWN /F "C:\WINDOWS\System32\OpenSSH" /A /R

  • Reset permissions, then grant full to users

    ICACLS "C:\WINDOWS\System32\OpenSSH" /T /Q /C /RESET ICACLS "C:\WINDOWS\System32\OpenSSH" /grant:r "users:(F)" /C /T

  • Service configuration

    Enable services

    Set-Service sshd -StartupType Automatic Set-Service ssh-agent -StartupType Automatic

    Start services

    Start-Service sshd Start-Service ssh-agent

    Get status of serives

    Get-Service sshd Get-Service ssh-agent

  • Securing keys

    Install-Module -Force OpenSSHUtils Repair-SshdHostKeyPermission -FilePath C:\Windows\System32\OpenSSH\ssh_host_ed25519_key

  • Helpful debug steps

It is helpful to manually run sshd with debug output enabled.

Stop-Service sshd
sshd -d
  • Open firewall port

    netsh advfirewall firewall add rule name="Tunnel TCP Port 2022" dir=in action=allow protocol=TCP localport=2022 netsh advfirewall firewall add rule name="Tunnel TCP Port 2022" dir=out action=allow protocol=TCP localport=2022

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