ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

如何让带证书的WCF服务 部署在以network service 帐户运行的Windows Service中 原创

2019-06-30 19:26:06  阅读:319  来源: 互联网

标签:exe b6c9 NETWORK Service certification 4147 service network


主要问题:
授权Network Service 帐户访问证书文件.
Install Service
安装WCF 服务
1.Import a server certification:

导入证书

Start=>Run mmc
开始=>运行mmc


File=>Add/Remove Snap-in
Certifications=>
文件=>添加删除管理单员


Certifications=>Add=>Computer Account
选择 证书=>添加=>计算机帐户


Right click on certification: All Task=>Import
Select the certification. Example: Create a test certification use MakeCert suppose server name is “dev01”
Start=>Programs=>Microsoft visual studio 2008=>visual studio tools=>visual studio command prompt (Right click run as administrator)
Run makecert.exe -sr LocalMachine -ss MY -a sha1 -n CN= dev01 -sky exchange –pe
(open mmc to see the certification)
2.Grant read purview to NETWORK SERVICE use FindPrivatekey tool to find the private key file store location of the certification imported just now.
For example (FindPrivatekey.exe in C:\) Open command prompt with administrator

From the picture above we can see that the private key file is in
F:\ProgramData\MicroSoft\Crypto\RSA\MachineKeys\ 1817c10fb6f21ea57a247b8d31ee9a0e_b0b895a9-b6c9-4147-a32c-d3e1c1659fa5 Open this folder:


Right click =>Properties=>Security=>Edit=>Add=>Advanced=>Find Now=>
Select NETWORK SERVIE =>Ok=>Uncheck Read & Execute => Ok


Notice: You can run a command instead of this action:
In Server 2008: ICacls F:\ProgramData\MicroSoft\Crypto\RSA\MachineKeys\1817c10fb6f21ea57a247b8d 31ee9a0e_b0b895a9-b6c9-4147-a32c-d3e1c1659fa5 /grant "NETWORK SERVICE":(R,WDAC)
In Server 2003: cacls.exe "C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\ RSA\MachineKeys\1817c10fb6f21ea57a247b8d\31ee9a0e_b0b895a9-b6c9-4147-a32c-d3e1c1659fa5 " /E /G "NETWORK SERVICE":R
3:Install

In Server 2003: cacls.exe "C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\ RSA\MachineKeys\1817c10fb6f21ea57a247b8d\31ee9a0e_b0b895a9-b6c9-4147-a32c-d3e1c1659fa5 " /E /G "NETWORK SERVICE":R

3:Install Service In Windows service Run Command prompt with administrator: Go to the install directory of dotnet framework For Example: The service host application is in C:\PlexusChartService\PlexusChartServiceHost.exe Run InstallUtil “C:\PlexusChartService\PlexusChartServiceHost.exe”


Now.It is run in network service account. Notice: Do not double click the certification to import the certification, In that case ,the private key file will be in the login user(administrator)’s folder.

转载于:https://www.cnblogs.com/CsharpFarmer/archive/2009/06/28/1512546.html

标签:exe,b6c9,NETWORK,Service,certification,4147,service,network
来源: https://blog.csdn.net/weixin_33698043/article/details/94347916

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有