mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-27 16:04:46 +02:00
Make some formatting fixes and clarifications based on internal feedback
parent
e771a640b9
commit
ebe15f7223
@ -1,35 +1,41 @@
|
|||||||
## Install Win32 OpenSSH (test release)
|
## Install Win32 OpenSSH (test release)
|
||||||
|
|
||||||
* Download the [latest](https://github.com/PowerShell/Win32-OpenSSH/releases/latest/) build. To get links to latest downloads - see [here](https://github.com/PowerShell/Win32-OpenSSH/wiki/How-to-retrieve-links-to-latest-packages). A [Chocolatey package](https://chocolatey.org/packages/openssh) is also available if you prefer. For compat issues on Nano see [issues on Nano](https://github.com/PowerShell/Win32-OpenSSH/issues/234). See [here](https://github.com/PowerShell/Win32-OpenSSH/issues/332) for PS script to automate installation and configuration.
|
* Download the [latest](https://github.com/PowerShell/Win32-OpenSSH/releases/latest/) build of OpenSSH.
|
||||||
* Extract contents to `C:\Program Files\OpenSSH`
|
To get links to latest downloads [this wiki page](https://github.com/PowerShell/Win32-OpenSSH/wiki/How-to-retrieve-links-to-latest-packages).
|
||||||
* Start Powershell as Administrator
|
A [Chocolatey package](https://chocolatey.org/packages/openssh) is also available if you prefer using Chocolatey.
|
||||||
* `cd 'C:\Program Files\OpenSSH'`
|
For compatibility issues on Nano see [issues on Nano](https://github.com/PowerShell/Win32-OpenSSH/issues/234).
|
||||||
* On Windows 10, in developer mode, a different implementation of SSH exists in-box. Look for TCP port bindings on port 22 and these processes - “SSH Server Broker” and “SSH Server Proxy”
|
If you're interested in a PowerShell script to automate installation and configuration check out [this issue](https://github.com/PowerShell/Win32-OpenSSH/issues/332).
|
||||||
* `netstat -anop TCP`
|
* Extract contents of the latest build to `C:\Program Files\OpenSSH`
|
||||||
* If you do see 22 occupied, [#610](https://github.com/PowerShell/Win32-OpenSSH/issues/610) has workarounds to deal with port conflict.
|
* Start Windows Powershell as Administrator
|
||||||
* Install sshd and ssh-agent services.
|
* Navigate to the OpenSSH directory
|
||||||
* `powershell -executionpolicy bypass -file install-sshd.ps1`
|
* `cd 'C:\Program Files\OpenSSH'`
|
||||||
* Setup SSH host keys
|
* On Windows 10, if you've [enabled Developer Mode](https://docs.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development), you probably have another implementation of SSH installed on your machine.
|
||||||
* `.\ssh-keygen.exe -A`.
|
To figure out if this is the case, look for TCP port bindings on port 22 and these services: “SSH Server Broker” and “SSH Server Proxy”
|
||||||
for instructions to set the right permissions on host keys.
|
* `netstat -anop TCP`
|
||||||
|
* 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`
|
||||||
|
* Generate SSH host keys
|
||||||
|
* `.\ssh-keygen.exe -A`
|
||||||
|
* Check out [this wiki page][Secure file] for instructions on how to set proper permissions on these host keys.
|
||||||
* Secure SSH host keys (optional)
|
* Secure SSH host keys (optional)
|
||||||
* `Start-Service ssh-agent`
|
* `Start-Service ssh-agent`
|
||||||
* download psexec from [here](https://technet.microsoft.com/en-us/sysinternals/pstools)
|
* Download psexec from [here](https://technet.microsoft.com/en-us/sysinternals/pstools)
|
||||||
* launch cmd.exe as SYSTEM - `psexec.exe -i -s cmd.exe`
|
* Launch cmd.exe as SYSTEM
|
||||||
* register host keys in above cmd.exe
|
* `psexec.exe -i -s cmd.exe`
|
||||||
* `ssh-add ssh_host_dsa_key`
|
* register host keys in above cmd.exe
|
||||||
* `ssh-add ssh_host_rsa_key`
|
* `ssh-add ssh_host_dsa_key`
|
||||||
* `ssh-add ssh_host_ecdsa_key`
|
* `ssh-add ssh_host_rsa_key`
|
||||||
* `ssh-add ssh_host_ed25519_key`
|
* `ssh-add ssh_host_ecdsa_key`
|
||||||
* host private keys are now securely stored by ssh-agent, private key files can be removed at this point.
|
* `ssh-add ssh_host_ed25519_key`
|
||||||
* Open Firewall
|
* Host private keys are now securely stored by ssh-agent, private key files can be deleted at this point.
|
||||||
* `New-NetFirewallRule -Protocol TCP -LocalPort 22 -Direction Inbound -Action Allow -DisplayName SSH`
|
* Open the firewall on TCP port 22 to allow inbound SSH connections
|
||||||
* Set sshd in auto-start mode and open up firewall (optional)
|
* `New-NetFirewallRule -Protocol TCP -LocalPort 22 -Direction Inbound -Action Allow -DisplayName SSH`
|
||||||
* `Set-Service sshd -StartupType Automatic`
|
* Setup `sshd` and `ssh-agent` to auto-start (optional)
|
||||||
* `Set-Service ssh-agent -StartupType Automatic`
|
* `Set-Service sshd -StartupType Automatic`
|
||||||
* Make the service start on boot (PowerShell): `Set-Service sshd -StartupType Automatic`
|
* `Set-Service ssh-agent -StartupType Automatic`
|
||||||
|
|
||||||
`New-NetFirewallRule` is for servers only. If you're on a workstation try:
|
Note: `New-NetFirewallRule` is for servers only. If you're on a client desktop machine (like Windows 10) try:
|
||||||
|
|
||||||
```
|
```
|
||||||
netsh advfirewall firewall add rule name='SSH Port' dir=in action=allow protocol=TCP localport=22
|
netsh advfirewall firewall add rule name='SSH Port' dir=in action=allow protocol=TCP localport=22
|
||||||
@ -37,9 +43,11 @@ netsh advfirewall firewall add rule name='SSH Port' dir=in action=allow protocol
|
|||||||
|
|
||||||
## Uninstall Win32 OpenSSH
|
## Uninstall Win32 OpenSSH
|
||||||
|
|
||||||
* Start Powershell as Administrator
|
* Start Windows Powershell as Administrator
|
||||||
* Uninstall
|
* Navigate to the OpenSSH directory
|
||||||
* `powershell.exe -executionpolicy bypass -file uninstall-sshd.ps1`
|
* `cd 'C:\Program Files\OpenSSH'`
|
||||||
|
* Run the uninstall script
|
||||||
|
* `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
|
[Secure file]: https://github.com/PowerShell/Win32-OpenSSH/wiki/Security-protection-of-various-files-in-win32-openssh
|
||||||
[build13]: https://github.com/PowerShell/Win32-OpenSSH/releases/tag/v0.0.13.0
|
[build13]: https://github.com/PowerShell/Win32-OpenSSH/releases/tag/v0.0.13.0
|
Loading…
x
Reference in New Issue
Block a user