클라이언트 측에서 자신의 인증서를 사용하여 RDP 파일에 서명하세요.
절차를 간소화하기 위해 여러 개의 파워셸 스크립트가 귀하의 사용을 위해 작성되었습니다. 사용하기 전에 변수의 값을 귀하의 것으로 변경해 주시기 바랍니다.
첫 번째 단계
먼저 내보낼 수 있는 개인 키가 있는 서명 인증서를 생성해야 합니다.
이 작업에는 관리자 권한이 필요합니다.
인증서의 지문이 사용자 구성 측에 있을 것임을 유의하십시오.
$organization = "MyCompany"$commonName = "RDP Signer"$friendlyName = "RDP Signing Certificate"$pfxPassword = "MyStrongPassword!"$pfxFilePath = [Environment]::CurrentDirectory + "\signer.pfx"# In years$validityDuration = 3
Write-Host Certificate will be created in $pfxFilePath
# Generate the signing certificate$cert = New-SelfSignedCertificate ` -Type CodeSigningCert ` -Subject "CN=$commonName, O=$organization" ` -KeyUsage DigitalSignature ` -KeyExportPolicy Exportable ` -FriendlyName $friendlyName ` -CertStoreLocation "Cert:\LocalMachine\My" ` -NotAfter (Get-Date).AddYears($validityDuration)
# Generate the pfx file to import on client computer$thumb = $cert.Thumbprint
Write-Host Certificate thumbprint: $thumb
$pwd = ConvertTo-SecureString -String $pfxPassword -Force -AsPlainTextGet-ChildItem -Path Cert:\LocalMachine\My\$thumb | Export-PfxCertificate -FilePath "$pfxFilePath" -Password $pwd
사용자 워크스테이션에서 두 번째 단계
서명 인증서가 생성되면, 클라이언트가 이를 사용하기 위해서는 다음과 같은 작업을 수행해야 합니다:
- “CurrentUser\My” 저장소에 인증서를 가져와 rdpsign을 사용하여 인증서 지문으로 rdp 파일에 서명할 수 있도록 합니다.
- “CurrentUser\Root” 저장소에 인증서를 가져와서 이 인증서로 서명된 rdp가 인식되도록 합니다.
$pfxFilePath = [Environment]::CurrentDirectory + "\signer.pfx"$pfxPassword = "MyStrongPassword!"
$pwd = ConvertTo-SecureString -String $pfxPassword -Force -AsPlainText
# Import pfx in CurrentUser\My certificate store to be able to sign with rdpsign using the thumbprintImport-PfxCertificate -FilePath "$pfxFilePath" -CertStoreLocation "Cert:\CurrentUser\My" -Password $pwd
# Import pfx to the trusted root certificate authority of the user, so that signed rdp with this certificate are recognized.# Note: this triggers a windows confirmation popupImport-PfxCertificate -FilePath "$pfxFilePath" -CertStoreLocation "Cert:\CurrentUser\Root" -Password $pwd
세 번째 단계 (사용자 작업 공간에서)
컴퓨터가 이 인증서로 서명된 rdp 파일을 완전히 신뢰하도록 하려면, 레지스트리의 신뢰할 수 있는 인증서 엄지 지문 목록에 추가해야 합니다.
위치: “HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Terminal Services”
키: “신뢰된 인증서 지문”
유형: 문자열
참고: HKEY_LOCAL_MACHINE에 작성하므로 관리자 권한이 필요합니다.
$thumbprint = "YOUR_THUMBPRINT"
$regPath = "HKLM:\Software\Policies\Microsoft\Windows NT\Terminal Services"$keyName = "TrustedCertThumbprints"
$current = (Get-ItemProperty -Path $regPath -Name $keyName -ErrorAction SilentlyContinue).$keyName$newValue = if ([string]::IsNullOrWhiteSpace($current)) { $thumbprint } else { "$current,$thumbprint" }
New-Item -Path $regPath -Force | Out-NullNew-ItemProperty -Path $regPath -Name $keyName -Value $newValue -PropertyType String -Force | Out-Null
사용자 워크스테이션에서의 네 번째 단계
마지막으로 “Connection Client” 프로그램에 귀하의 인증서를 사용하여 서명하고 지문으로 서명하도록 지시하려면 다음 레지스트리 키를 설정해야 합니다: 위치: “HKEY_CURRENT_USER\Software\Digital River\ConnectionClient”
또는
위치: “HKEY_LOCAL_MACHINE\Software\Digital River\ConnectionClient”
키: “CertThumbprint”
유형: 문자열
값: 당신의 지문
$thumbprint = "YOUR_THUMBPRINT"New-ItemProperty -Path "HKCU:\Software\Digital River\ConnectionClient" -Name "CertThumbprint" -PropertyType String -Value $thumbprint -Force