본문 바로가기

운영체제/Windows

WinRM - HTTPS Listener 구성

반응형
1.Listener 확인 및 삭제

> winrm enumerate winrm/config/listener

> winrm delete winrm/config/Listener?Address=*+Transport=HTTPS

2.인증서 생성

> New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName $env:COMPUTERNAME

thumbprint 확인

3.HTTPS Listener 생성

> winrm create winrm/config/Listener?Address=*+Transport=HTTPS '@{Hostname=“<hostname>"; CertificateThumbprint=“<thumbprint>"}'

4.방화벽 정책 추가 및 Windows Remote Management 서비스 재시작

> New-NetFirewallRule -DisplayName "Windows Remote Management (HTTPS-In)" -Name "Windows Remote Management (HTTPS-In)" -Profile Any -LocalPort 5986 -Protocol TCP

5.연결 테스트

> Enter-PSSession -ComputerName <hostname or IP> -Credential (Get-Credential) -SessionOption (New-PsSessionOption -SkipCACheck -SkipCNCheck) -UseSSL

반응형