Updated Install Win32 OpenSSH (markdown)

Yanbing 2017-05-11 17:59:41 -07:00
parent 9fb92f62aa
commit 2a6f356373

@ -9,11 +9,12 @@
* If you do see 22 occupied, [#610](https://github.com/PowerShell/Win32-OpenSSH/issues/610) has workarounds to deal with port conflict.
* Install sshd and ssh-agent services.
* `powershell -executionpolicy bypass -file install-sshd.ps1`
* Setup SSH host keys (This will generate all the 'host' keys that sshd expects when its starts. The 'host' keys have current user as file owner and granted full control access starting from build v0.0.13.0.)
* `.\ssh-keygen.exe -A`
* (Required starting build v0.0.13.0. ) Grant "NT service\sshd" read access the host private key files:
* Setup SSH host keys
* `.\ssh-keygen.exe -A` (This will generate all the 'host' keys that sshd expects when its starts. The generated 'host' keys are [secured][Secure file] starting from build v0.0.13.0.)
* If existing host keys are used instead of generate new, make sure they are [secured][Secure file].
* (Required starting build v0.0.13.0. ) Grant "NT service\sshd" Read access the host key files:
```
Get-ChildItem -Path 'C:\Program Files\OpenSSH\ssh_host_*_key' | % {
Get-ChildItem -Path 'C:\Program Files\OpenSSH\ssh_host_*_key*' | % {
$acl = get-acl $_.FullName
$ar = New-Object System.Security.AccessControl.FileSystemAccessRule("NT Service\sshd", "Read", "Allow")
$acl.SetAccessRule($ar)
@ -24,7 +25,7 @@
* `Start-Service ssh-agent`
* download psexec from [here](https://technet.microsoft.com/en-us/sysinternals/pstools)
* launch cmd.exe as SYSTEM - `psexec.exe -i -s cmd.exe`
* register host keys in above cmd.exe
* register [secured][Secure file] host keys in above cmd.exe
* `ssh-add ssh_host_dsa_key`
* `ssh-add ssh_host_rsa_key`
* `ssh-add ssh_host_ecdsa_key`
@ -48,3 +49,5 @@ netsh advfirewall firewall add rule name='SSH Port' dir=in action=allow protocol
* Start Powershell as Administrator
* Uninstall
* `powershell.exe -executionpolicy bypass -file uninstall-sshd.ps1`
[Secure file]: https://github.com/PowerShell/Win32-OpenSSH/wiki/Security-protection-of-various-files-in-win32-openssh