powershell v2 원격 - 암호화되지 않은 트래픽을 활성화하는 방법
원격 서버에 대해 실행하고 싶은 파워셸 v2 스크립트를 작성하고 있습니다.실행할 때 다음 오류가 발생합니다.
원격 서버에 연결하지 못했습니다. WinRM 클라이언트에서 요청을 처리할 수 없습니다.암호화되지 않은 트래픽은 현재 클라이언트 구성에서 사용할 수 없습니다.클라이언트 구성을 변경하고 요청을 다시 시도합니다.자세한 내용은 about_Remote_를 참조하십시오.문제 해결 도움말 항목.
저는 _Remote_에 대한 온라인 도움말을 보았습니다.문제 해결. 하지만 암호화되지 않은 트래픽을 활성화하는 방법을 알려주지 않았습니다.아래는 제가 사용하고 있는 스크립트로 인해 문제가 발생하고 있습니다.
참고: 이미 원격 컴퓨터에서 Enable-PSRemoting을 실행하여 수신 요청을 허용합니다.
세션 옵션 변수를 사용하려고 했지만 아무런 차이가 없는 것 같습니다.
$key = "HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds"
Set-ItemProperty $key ConsolePrompting True
$tvar = "password"
$password = ConvertTo-SecureString -string $tvar -asPlainText –force
$username="domain\username"
$mySessionOption = New-PSSessionOption -NoEncryption
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
invoke-command -filepath C:\scripts\RemoteScript.ps1 -sessionoption $mySessionOption -authentication digest -credential $credential -computername RemoteServer
암호화되지 않은 트래픽을 활성화하려면 어떻게 해야 합니까?
암호화 허용은 클라이언트 측에서 WSMAN: 드라이브를 통해 정의됩니다.powershell.exe(또는 powershell_ise.exe)를 상승된 프로세스로 실행해야 합니다.
ps> cd WSMan:\localhost\Client
ps> dir
Name Value
---- -----
NetworkDelayms 5000
URLPrefix wsman
AllowUnencrypted false
Auth
DefaultPorts
TrustedHosts
(위 디렉터리로 변경한 후) 다음과 같이 변경합니다.
Set-Item .\allowunencrypted $true
이게 도움이 되길 바랍니다.
- 오이신
클라이언트와 서비스 모두에서 암호화되지 않은 구성 허용 설정을 설정해야 합니다.원격 서버에서 다음을 사용하여 서비스 설정을 변경해야 합니다.
set-item -force WSMan:\localhost\Service\AllowUnencrypted $true
또한 Digest Authorization을 활성화하는 것도 잊지 마십시오.
set-item -force WSMan:\localhost\Service\Auth\Digest $true
다음 명령을 사용하여 클라이언트에서 암호화되지 않은 트래픽을 허용할 수 있습니다(클라이언트에서 실행).
winrm set winrm/config/client '@{AllowUnencrypted="true"}'
다음 명령을 사용하여 전체 구성(클라이언트 및 서비스)을 확인할 수 있습니다.
winrm get winrm/config
각 시스템에는 두 가지 구성(하나는 클라이언트용, 다른 하나는 서버용)이 있습니다.서버에서 암호화되지 않은 트래픽을 허용하려면 서버에서 다음 명령을 실행합니다.
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
이것은 저에게 효과가 있었습니다.
enable-wsmancredssp –role server
매개 변수인 경우AllowUnencryptedTraffic
아래에 있습니다.GPO
레지스트라를 통해 설정할 수 있습니다.
$RegPath = 'HKLM:\Software\Policies\Microsoft\Windows\WinRM\Client'
$RegUnencryptedTraffic = 'AllowUnencryptedTraffic'
$RegValue = '1'
Set-ItemProperty -Path $RegPath -Name $RegUnencryptedTraffic -Value $RegValue
언급URL : https://stackoverflow.com/questions/1469791/powershell-v2-remoting-how-do-you-enable-unencrypted-traffic
'programing' 카테고리의 다른 글
URL 해시 위치를 가져와 jQuery에서 사용 (0) | 2023.08.27 |
---|---|
div에 1px 테두리를 추가하면 div 크기가 증가합니다. 원하지 않습니다. (0) | 2023.08.27 |
단추 사용 안 함 (0) | 2023.08.27 |
측정 시 사용자 정의 보기 설명 (0) | 2023.08.27 |
Rest api - 단일 리소스 필드 업데이트 (0) | 2023.08.27 |