Named pipe client unable to connect to server running as Network Service

前端 未结 2 1574
清酒与你
清酒与你 2021-01-11 23:11

I have a service running under the Network Service account. The service just sets up a named pipe and listens for connections:

NamedPipeServerStream listenin         


        
2条回答
  •  离开以前
    2021-01-12 00:06

    I'm not allowed to comment, but I want to point out that dvansanth's answer is correct depending on the OS language. When the OS language isn't English, the "Everyone" group probably won't exist.

    I've solved it like this:

    PipeSecurity pipeSa = new PipeSecurity();
    pipeSa.SetAccessRule(new PipeAccessRule(new SecurityIdentifier(WellKnownSidType.AuthenticatedUserSid, null), 
                    PipeAccessRights.ReadWrite, AccessControlType.Allow)); 
    listeningPipe.SetAccessControl(pipeSa);
    

    Note this is for "Authenticated users" not "Everyone"

提交回复
热议问题