plink 选美无法在 ASP.NET 上运行
简而言之,问题是: 运行 plink(带有特定参数)可以从 cmd 运行,但不能从 asp.net
执行的命令运行: 来自 cmd 的"C:\Program Files (x86)\PuTTY\plink.exe" -batch abc@xyz ./fake_email.sh
,命令正确执行,fake_email.sh 返回“0”。从 asp.net 我收到以下错误: 服务器的主机密钥未缓存在注册表中。你 无法保证服务器就是您的计算机 我认为是的。 服务器的 rsa2 密钥指纹是: ssh-rsa 2048 序列 连接已放弃。
我认为这与用户(.net 用于启动进程)无法“看到”选美比赛提供的密钥有关。我正在以管理员身份运行cmd。
我很高兴发布更多信息。
谁能指出我正确的方向?
感谢您的帮助。
the problem in a nutshell:
running plink(with specific arguments) works from cmd, but not from asp.net
the command being executed:
"C:\Program Files (x86)\PuTTY\plink.exe" -batch abc@xyz ./fake_email.sh
from cmd, the command executes correctly, with fake_email.sh returning "0". from asp.net i get the following error:
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 sequence
Connection abandoned.
i think it has something to do with the user(which .net uses to start a process) not being able to "see" the key which pageant is making available. i am running cmd as administrator.
i am happy to post more info.
can anyone point me in the right direction?
thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了它。
默认情况下,asp.net 以“NetworkService”用户身份执行进程。我无法缓存该用户的密钥,因此我决定创建一个新用户,并将其分配为 IIS 中应用程序池的标识。因为我创建了这个用户,所以我能够在注册表中缓存该密钥(仅使用 cmd)。
solved it.
asp.net by default executes processes as "NetworkService" user. i was unable to cache the key for that user, so i decided to create a new user, which i assign as the identity of the application pool in IIS. because i created this user, i am able to cache the key in the registry (just using cmd).