psexec 的嵌套调用出现问题(访问被拒绝)
首先,抱歉我的英语不好。 我会尝试解释我的问题。
我在脚本中使用 psexec 来重新启动集群,如下所示:
node1 中的 script1:在 node1 中执行大量任务(关闭服务、检查状态等),并在使用 psexec 完成所有任务启动后,在 node2 中执行 script2 ( psexec -d \\node2 script2)
node2中的script2:执行大量任务并启动node1中的script3。 这是当我尝试在 node1 中运行 script3 时,在 psexec 中收到“访问被拒绝”的消息。 (psexec-d \\ nodo1 script3)
我使用属于组管理员的用户启动脚本。
出于安全原因,我无法传递用户名和密码,因为将凭据保留在 .bat 文件中是不安全的。
附加信息:
我正在 W2k3 服务器中运行脚本 我尝试了网络使用,一切正常 我尝试使用 -u 用户名和 -p 用户名进行 psexec ,一切正常 我尝试使用以下语法执行 psexec: psexec .exe -d \node1 cmd.exe "script3.bat" 并返回相同的错误。
非常感谢 此致
First of all, sorry for my poor english. I would try to explain my problem.
I am using psexec within a script to restart a cluster as follows:
script1 in node1: perform a lot of tasks (shutdown services, check status, etc..) in the node1 and after completing all task launch with psexec the script2 in node2 (psexec-d \ \ node2 script2)
script2 in node2: perform a lot of tasks and launches script3 in node1. Here is, when i recived an "access denied" in psexec when I try to run the script3 in node1. (psexec-d \ \ nodo1 script3)
I launch the script with an user that belongs to the group administrators
For security reasons I can not pass username and password, because it is not safe to leave the credentials in a .bat file.
Additional info:
I´m running the script in W2k3 server
I tried a net use and its all ok
I tried a psexec with -u username and -p username and its all ok
I tried to exec psexec with this syntax: psexec .exe -d \node1 cmd.exe "script3.bat" and returns the same error.
Thks a lot
Best Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
最后,我决定在第二个脚本中使用看门狗进程,因此该脚本将由该进程启动,而不是由 psexec 启动。
非常感谢您的帮助以及您花时间帮助我。
此致
Finally I have decided to use a watchdog process in the second script, so the script will be launched by this process instead of being launched by psexec.
Thanks a lot for your help and your time devoted to help me.
Best regards
这可能与使用集成身份验证从太多链接服务器跃点获取的问题有关 - a 双跳 Kerberos 问题。
由于集成 Windows 身份验证涵盖两种独立的身份验证机制:
如果您使用 Kerberos,由于用户的密码永远不会传递到 IIS 服务器,因此 IIS 服务器上的令牌的唯一方法是跳转到另一个服务器网络上的机器是通过 Kerberos 委派。 如果这是不可用或不允许的,那么跳跃将不会发生(这听起来像是正在发生)。
鉴于您使用的是默认凭据,并且如果当前安全上下文是无法委托的模拟令牌,则您提供的凭据将不会跳转到
另一台机器。
由于 Windows 集成身份验证创建了一个模拟令牌,因此这种情况很可能发生。
来源:
It may be related with an issue that one gets from too many linked server hops using integrated authentication - a double-hop Kerberos problem.
Since Integrated Windows Authentication covers two separate authentication mechanisms:
if you are using Kerberos, since the user's password is never passed to the IIS server, the only way the token on the IIS server is going to hop to another machine on the network is via Kerberos Delegation. If that isn't available or allowed, then the hop won't happen (which is what it sounds like is happening).
Given that you are using default credentials, and if the current security context is an impersonation token that can not delegate, then the credentials you supply will not hop to
the other machine.
Since Windows integrated authentication creates an impersonation token, this is very likely to be the case.
Sources:
您可以让对 script2 的调用等待完成,而不是让 script2 回调到 node1:
Can you make the call to script2 wait for completion, rather than have script2 call back to node1: