Windows/SSHD: Difference between revisions
< Windows
(Created page with "== Install OpenSSH == Install the Inbox Version: <ref>https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=powershell&pivots=windows-11</ref> # In Admin window: # Verify Admin (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) # Verify Capabilities Get-WindowsCapability -Online | Where-Object Name -lik...") |
No edit summary |
||
| Line 10: | Line 10: | ||
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*' | Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*' | ||
<pre> | |||
# Install the OpenSSH Client | |||
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 | |||
# alternative | |||
Add-WindowsCapability -Online -Name OpenSSH.Client* | |||
# alternative | |||
</pre> | |||
<pre> | |||
# Install the OpenSSH Server | |||
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 | |||
# alternative | |||
Add-WindowsCapability -Online -Name OpenSSH.Server* | |||
</pre> | |||
OR Install OpenSSH Preview/Beta Version with WinGet | OR Install OpenSSH Preview/Beta Version with WinGet | ||
Revision as of 18:31, 11 March 2026
Install OpenSSH
Install the Inbox Version: [1]
# In Admin window:
# Verify Admin (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
# Verify Capabilities Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
# Install the OpenSSH Client Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 # alternative Add-WindowsCapability -Online -Name OpenSSH.Client* # alternative
# Install the OpenSSH Server Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 # alternative Add-WindowsCapability -Online -Name OpenSSH.Server*
OR Install OpenSSH Preview/Beta Version with WinGet
# Preview version winget install Microsoft.OpenSSH.Preview
# Beta version winget install Microsoft.OpenSSH.Beta
Start the sshd service
Start-Service sshd
OPTIONAL but recommended, Set the service to start automatically:
Set-Service -Name sshd -StartupType Automatic
Open firewall: (owershell)
# Confirm the Firewall rule is configured. It should be created automatically by setup. Run the following to verify
if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue)) {
Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..."
New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
} else {
Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists."
}
# alternative New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22