- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
Windows 任务计划程序可以创建使用特定用户帐户运行的任务,而无需存储用户密码。他们称之为“S4U”,为用户服务。这应该像调度程序为当前用户创建这样的 token 一样工作,并可以使用它在该用户帐户下运行计划的进程。他们声称它无法使用该系统访问网络或加密资源。调度程序本身使用 SYSTEM 帐户运行以使其工作。这是一个 article that describes it .相关引述:
TASK_LOGON_S4U is yet another option that provides a more secure alternative. It takes advantage of a service for user (S4U) logon to run the task on behalf of the specified user, but without having to store the password. Since the Task Scheduler runs within the local system account, it can create a S4U logon session and receive a token that can not only be used for identification, but also for impersonation on the local computer. Normally a S4U token is only good for identification.
我需要在我的应用程序中使用此身份验证方案,但不能让任务计划程序执行此操作而需要我自己执行,因为我需要它用于任意数量的帐户。每当用户向我的应用程序注册任务时,任何后续任务都必须在同一用户下运行。但由于它们不能重叠,我需要自己进行序列化。
我找不到关于这个“S4U”的任何信息。我怎样才能在我的应用程序中实现它?首选 C#,但 WINAPI 和 C 也可以。
更新:这是我尝试过的方法,但它不起作用。
// The WindowsIdentity(string) constructor uses the new
// Kerberos S4U extension to get a logon for the user
// without a password.
WindowsIdentity wi = new WindowsIdentity(identity);
WindowsImpersonationContext wic = null;
try
{
wic = wi.Impersonate();
// Code to access network resources goes here.
}
catch()
{
// Ensure that an exception is not propagated higher in the call stack.
}
finally
{
// Make sure to remove the impersonation token
if( wic != null)
wic.Undo();
}
但我现在的印象是,你不能只说你想成为某个用户。甚至不作为系统。您需要以该用户身份登录,并且可以生成一些 token ,使您可以在以后再次成为该用户,而无需密码。所以这一定是一个两步的事情,首先我需要获取 token 并将其存储在磁盘上;稍后我可以使用该 token 来模拟。这些例子都没有解释这一点。
最佳答案
“计算机可能没有加入域”
S4U 需要访问 KDC。 S4U实际上是两个协议(protocol)。 S4U2Self 和 S4U2Proxy。它正在做的是使用 Kerberos 的附加功能来为用户获取服务票证,但是用于获取票证的帐户必须启用特殊委托(delegate)。 See here对于这个设置。
但是除非您真的让进程终止等,否则为什么不直接获取用户服务票证或 TGT?您的应用程序是本地应用程序还是对用户远程运行的服务?
任务调度程序需要去获得一个新的,因为服务票证不是永远有效的。或者在某些委托(delegate)方案中,用户没有将服务票证传递给应用程序服务器,然后 AS 通过 S4U2Self 去请求和服务票证,然后使用该服务票证通过 S4U2Proxy 请求第二个服务的票证。
关于windows - 为用户 (S4U) token 创建服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24123440/
为什么我可以在控制台 window.window.window.window 中执行此操作并无限追加 .window 并返回 DOM 窗口? 最佳答案 因为 window 对象有一个指向它自身的 wi
Windows管理员用户和系统用户之间有什么权限区别吗? 有些时候,我必须将 cmd 窗口提升到系统权限才能删除一些文件。这可能是因为系统用户锁定了文件,或者系统用户可能具有更高的访问权限,我希望找出
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
Windows 服务和 Windows 进程之间的区别是什么? 最佳答案 服务是真正的 Windows 进程,没有区别。服务的唯一特殊之处在于它由操作系统启动并在单独的 session 中运行。一个独
我有一个 Windows 网络 (peer-2-peer) 以及 Active Directory,我需要记录向服务器发送任何类型打印的用户的名称。我想编写一个程序来记录他们的用户名和/或他们各自的
当我让一个 Windows 服务尝试安装另一个 Windows 服务时遇到问题。 具体来说,我有一个 TeamCity 代理在 Windows 2008 AWS 实例上为我运行测试。这些测试是用 Ja
我创建了一个应用程序来接收广播的 Windows 消息,效果很好。当我把它变成一个服务、安装它并启动服务时,该服务没有收到消息。 最佳答案 服务可能必须被授予访问桌面的权限。从服务属性、“登录”选项卡
我正在使用 Delphi 2010 编写应用程序。我希望在 Windows 启动时启动我的应用程序。我需要它在最新版本的 Windows XP、7.0 和最新的服务器中工作。 将其存储在以下关键工作下
我想开发一个适用于所有三个版本的 Windows XP、Vista 和 7 的应用程序。该应用程序允许人们选择要打开的文件,并允许他们在某些操作后保存文件。三个版本的 Windows 中的每一个都有不
对于\Windows\中的文件类型与\Windows\System32 中的文件类型是否有标准约定? 我正在开发一个 SDK,其中包含各种 DLL、帮助程序 exe 和 Windows 服务 exe。
要求是,必须在 WINDOWS7 机器上配置自动登录,但是这个自动登录应该等待(即延迟)直到另一个 Windows 服务发出继续自动登录的信号。 我使用了自定义凭据提供程序,它在其中等待另一个 Win
很抱歉,这不是一个大问题,而是更多的帮助人们解决这些特定问题的方法。我正在解决的问题要求使用串行I/O,但主要在Windows CE 6.0下运行。但是,最近有人问我是否也可以在Windows下运行该
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
不幸的是 SC 命令在 W2000 上还不可用,所以我不能使用它。 我正在尝试检查服务是否在 W2000 服务器上运行,如果它没有运行,脚本应该能够启动该服务。 如何在 Windows 2000 上执
如何在登录到 Windows 之前启动 Windows 窗体应用程序?是否可以在登录到 Windows 之前启动 Windows 窗体应用程序?如果不是,我是否有机会在登录前启动 Windows 服务
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
我想在 XML 文件中区分 Windows XP 和 Windows 7。我想我会在 XML 中为它使用一个环境变量。 但是我找不到在 Windows 中定义的任何系统环境变量来提供此信息。 我看到了
有谁知道我可以在注册表中的哪个位置检查机器上是否安装了这些应用程序: Windows 通讯录 Windows 联系人 最佳答案 来自 Microsoft:我知道它说的是 win 95,但 reg 是一
我正在尝试从我的 Windows 服务器调用放置在远程 Windows 服务器上的批处理文件。我在远程服务器上安装了 freeSSHd。我尝试使用 putty/plink 但没有结果。 我使用的命令语
( 大家好。我是 Windows 编程的新手,所以如果已经有人问过我,我提前道歉,我只是不知道要搜索什么,但这个问题一直让我发疯,我知道有人可能真的很容易回答这个问题。) 我的公司有一个在 Windo
我是一名优秀的程序员,十分优秀!