본문 바로가기
OS-OE Knowledge/Windows KB

Windows 1x, SSH Server 구성

by 스쳐가는인연 2023. 2. 15.

Windows 10, Windows 11 SSH Server 구성:

1) Check status for SSH tools via POSH
PS> Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'

Name : OpenSSH.Client~~~~0.0.1.0
State : NotPresent << 미설치
또는,
State : Installed << 설치

Name : OpenSSH.Server~~~~0.0.1.0
State : NotPresent

2) Install OpenSSH Server
PS> Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

Note. 아래 형태의 Progress bar를 통해 상태를 업데이트 해줌
Operation
Runining
[ooo .... ]


# Start the sshd service
PS> Start-Service sshd

# Status of the sshd service
PS> Get-Service sshd

# Stop the sshd service
PS> Stop-Service sshd

# OPTIONAL but recommended:
PS> Set-Service -Name sshd -StartupType 'Automatic'

# Confirm the Firewall rule is configured. It should be created automatically by setup. Run the following to verify
PS> if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) {
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."
}

참고자료:
OpenSSH 관리(설치/사용/제거)
https://learn.microsoft.com/ko-kr/windows-server/administration/openssh/openssh_install_firstuse




반응형