원격 서버(Windows Server 2022 Standard)에서 원격 PS 세션을 여는 데 어려움을 겪고 있습니다. 원격 서버는~ 아니다도메인의 일부.
명령을 실행할 때
Enter-PSSession -ComputerName server01 -Credential server01\administrator
"액세스가 거부되었습니다"라는 메시지가 나타납니다.
내가 뭘 한거지:
- 섬기는 사람
Enable-PSRemoting
Enable-WSManCredSSP -Role server
- 고객
Add-Content -Path C:\Windows\System32\drivers\etc\hosts -Value "`n192.168.1.250`tserver01"
winrm quickconfig
Set-Item WSMan:\localhost\Client\TrustedHosts -Value server01
클라이언트에서 실행하는 경우
Enter-PSSession -ComputerName server01 -Credential server01\administrator
내가 받은 비밀번호를 입력하세요.
Enter-PSSession: Beim Verbinden mit dem Remoteserver "server01" ist folgender Fehler aufgetreten: Zugriff verweigert Weitere Informationen finden Sie im Hilfthema "about_Remote_Troubleshooting". Zeile:1 Zeichen:1 + Enter-PSSession -ComputerName server01 -Credential server01\administrator + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (server01:String) [Enter- PSSession], PSRemotingTransportException + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
클라이언트에서 실행할 때
winrm identify -r:http://server01:5985 -u:server01\Administrator -p:secret
나는 받는다
WSManFault 메시지 = Zugriff verweigert
Fehlernummer: -2147024891 0x80070005 Zugriff 버전
내가 무엇을 놓치고 있나요?
업데이트:
Auth/Basic
winrm 구성에서 and AllowUnencrypted
to true
(클라이언트와 서비스 모두)를 설정했는데 결과는 동일합니다. 나는 그때구성된 HTTPS 액세스자체 서명된 인증서를 사용하면 동일한 결과를 얻을 수 있습니다.
서버 측 에 항목이 없으므로 Microsoft-Windows-Windows Remote Management/Operational
클라이언트 측에서 요청이 차단된 것처럼 보입니다. Test-NetConnection -ComputerName server01 -Port 5985
성공합니다(포트 5986과 마찬가지로).
답변1
도메인이 아닌 사용자를 사용하고 있기 때문에 내 첫 번째 추측은 그것이 UAC
당신을 차단할 수 있다는 것입니다.
이 오류는 클라이언트에 의해 발생하므로 먼저 UAC
클라이언트에서 비활성화된 상태로 시도해 보세요. 이것이 작동하지 않으면 UAC
서버에서 disbale하십시오.
관련이 없다면 이 로컬 관리자 계정은 서버 그룹 UAC
의 구성원이어야 한다고 생각할 수 있습니다 .Remote Management Users
적어도 그것이 내가 다음에 시도할 것입니다.
답변2
winrm get winrm/config
서버 의 출력을 포함해야 합니다 . HTTP를 통한 기본 인증 사용자격 증명을 네트워크를 통해 암호화되지 않은 호스트로 보냅니다.이므로 일반적으로 서비스에 대해 기본적으로 비활성화되어 있습니다.
또한 Windows 원격 관리 이벤트 로그(Microsoft-Windows-Windows 원격 관리/운영)를 확인하세요.
winrm get winrm/config
Config
MaxEnvelopeSizekb = 500
MaxTimeoutms = 60000
MaxBatchItems = 32000
MaxProviderRequests = 4294967295
Client
NetworkDelayms = 5000
URLPrefix = wsman
AllowUnencrypted = false
Auth
Basic = true
Digest = true
Kerberos = true
Negotiate = true
Certificate = true
CredSSP = false
DefaultPorts
HTTP = 5985
HTTPS = 5986
TrustedHosts
Service
RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
MaxConcurrentOperations = 4294967295
MaxConcurrentOperationsPerUser = 1500
EnumerationTimeoutms = 240000
MaxConnections = 300
MaxPacketRetrievalTimeSeconds = 120
AllowUnencrypted = false
Auth
Basic = false **
Kerberos = true
Negotiate = true
Certificate = false
CredSSP = false
CbtHardeningLevel = Relaxed
DefaultPorts
HTTP = 5985
HTTPS = 5986
IPv4Filter = *
IPv6Filter = *
EnableCompatibilityHttpListener = false
EnableCompatibilityHttpsListener = false
CertificateThumbprint
AllowRemoteAccess = true
Winrs
AllowRemoteShellAccess = true
IdleTimeout = 7200000
MaxConcurrentUsers = 2147483647
MaxShellRunTime = 2147483647
MaxProcessesPerShell = 2147483647
MaxMemoryPerShellMB = 2147483647
MaxShellsPerUser = 2147483647
답변3
해결책을 찾았습니다. 나는 단지 명령 -Authentication Basic
에 추가하기만 하면 되었다 Enter-PSSession
.
전체 명령:
Enter-PSSession -ComputerName server01 -Authentication Basic -Credential administrator
사용할 때 winrm identify
다음을 추가해야 했습니다 -auth:basic
.
winrm identify -r:http://server01:5985 -a:basic -u:Administrator -p:secret
그렇게 간단했습니다 ...