简体   繁体   English

IIS 7.5(将进程标识设置为用户)具有错误的USERPROFILE

[英]IIS 7.5 with process idenity set to user has wrong USERPROFILE

First of all, this is my third question on the similar topic.. and still I have no answer, maybe only approaching it (see first , second ). 首先,这是我在类似主题上的第三个问题..但我仍然没有答案,也许只能回答这个问题(请参阅第一个第二个 )。

My web application (ASP.NET MVC3 under IIS 7.5) runs git to access some github repositories. 我的Web应用程序(IIS 7.5下的ASP.NET MVC3)运行git来访问某些github存储库。 After I upgraded my workstation to Windows SP1 it stopped to work. 将工作站升级到Windows SP1后,它停止工作。 The reason was that as soon as git started, it actually runs ssh.exe to communicate with github. 原因是git一旦启动,它实际上就运行ssh.exe与github通信。 The ssh.exe appears to hangs up, so all application hangs. ssh.exe似乎挂断了,因此所有应用程序挂起。

The application pool used by that application use the same process identity as myself. 该应用程序使用的应用程序池使用与我自己相同的进程标识。 But using ProcessHacker I can see following picture: 但是使用ProcessHacker可以看到以下图片:

w3wp流程环境

Because of USERPROFILE is pointed to /system32/config/systemprofile ssh.exe is expecting to have .ssh folder, that contains public/private keys. 由于USERPROFILE指向/ system32 / config / systemprofile,因此ssh.exe期望具有.ssh文件夹,其中包含公用/专用密钥。 Since keys are not there it hangs. 由于没有钥匙,它会挂起。

But keys are typically in ~/.ssh (in my case c:\\users\\alexander.beletsky.ssh). 但是密钥通常在〜/ .ssh中(在我的情况下为c:\\ users \\ alexander.beletsky.ssh)。 As soon as I copied keys into /system32/config/systemprofile application started to work as expected. 我将密钥复制到/ system32 / config / systemprofile中后,应用程序即开始按预期工作。

My question is, why does w3wp.exe thinks that its profile in /system32/config/systemprofile? 我的问题是,为什么w3wp.exe认为它的配置文件在/ system32 / config / systemprofile中? is it possible to change that? 有可能改变吗? it is expected behaviour for application pool or just issue of my machine? 它是应用程序池的预期行为还是仅是我的计算机的问题?

Waiting for any clues! 等待任何线索!

EDIT 编辑

Load User Profile property of Application Pool is set to TRUE. 应用程序池的“加载用户配置文件”属性设置为TRUE。

ssh.exe is actually using HOME environment variable. ssh.exe实际上正在使用HOME环境变量。 Check if it set correctly. 检查设置是否正确。

As my machine on which this works has the same value in enviroment page of process hacker, and still 因为我的机器在进程黑客的环境页面中具有相同的值,并且仍然

Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) has value of my user appData, and I have SP1, I think that it should not be related to it, but to something in your configuration that could have been changed. Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)具有我的用户appData的值,并且我具有SP1,我认为它不应与之相关,而应与您配置中的某些内容有关。 Check if your inetmgr has properly set identity for your application. 检查您的inetmgr是否已为您的应用程序正确设置了身份。 Open C:\\inetpub\\temp\\appPools\\yourAppPoolName\\yourAppPoolName.config and check if this setting exists: 打开C:\\ inetpub \\ temp \\ appPools \\ yourAppPoolName \\ yourAppPoolName.config并检查此设置是否存在:

<configuration>
    ....
  <system.applicationHost>
    <sites>
      <site name="Default Web Site" id="1" serverAutoStart="true">
       <application path="/yourAppPath" applicationPool="yourAppPoolName">
                <virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot\yourAppPath" userName="yourUserName" password="[enc:AesProvider:someHashHere=:enc]" />
       </application>
       ...
      </site>
    </sites>
  <system.applicationHost>

<configuration>

If not, you can configure it there (put password in plain text or you can configure it using inetmgr like I described in my answer to your other question). 如果没有,则可以在此处进行配置(以纯文本形式输入密码,也可以使用inetmgr进行配置(如我在回答其他问题时所述)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM