Windows/SSHD: Difference between revisions

From Omnia
Jump to navigation Jump to search
(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*'


# Install the OpenSSH Client
<pre>
Add-WindowsCapability -Online -Name OpenSSH.Client[[User:Kenneth|Kenneth]] ([[User talk:Kenneth|talk]]) 18:30, 11 March 2026 (UTC)0.0.1.0
# Install the OpenSSH Client
# alternative:
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Add-WindowsCapability -Online -Name OpenSSH.Client*
# alternative
Add-WindowsCapability -Online -Name OpenSSH.Client*
# alternative
</pre>


# Install the OpenSSH Server
<pre>
Add-WindowsCapability -Online -Name OpenSSH.Server[[User:Kenneth|Kenneth]] ([[User talk:Kenneth|talk]]) 18:30, 11 March 2026 (UTC)0.0.1.0
# Install the OpenSSH Server
# alternative:
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Add-WindowsCapability -Online -Name OpenSSH.Server*
# 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