启动一个在受限用户中具有更多用户权限的程序

发布于 2024-08-12 21:34:19 字数 211 浏览 3 评论 0原文

我的用户对我的一个硬盘的访问权限受到限制。这些用户无权删除该驱动器中的文件。但我有一个应用程序应该允许这些用户删除上述驱动器中的文件。

1)我该怎么做?

2)当低特权用户登录到我的应用程序时,我可以编写一个隐藏线程/程序来赋予高特权用户权限(仅适用于该应用程序),就像冒充另一个用户一样,以便他能够通过以下方式删除文件这个应用程序在受限制的硬盘上吗?

谢谢

I have users with limited access granted to one of my hard drives. Those users are not given the permittion to delete the files in that drive. but I have a application that should allow those users to delete files in the above mentioned drive.

1) How can I do this?

2) When a low priviliaged user loged to my application, can I write a hidden thread/ program that that gives high privileged user authority (only for this application), as in impersonating another user, so that he will be abel to delete files via this appliction in the restricted hard disk?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眼眸印温柔 2024-08-19 21:34:19

根据您的操作系统,您可以执行各种操作。

在类似 UNIX 的环境中,您可以编写程序并使用 setuid 或 setguid,以便它以另一个(更特权)用户的权限运行。

或者,在 Windows 或 UNIX 中,您可以以更有特权的用户身份运行服务,并让它接受来自其他用户/进程的请求,以代表他们执行操作。您必须研究与该服务进行通信的方法。

希望有帮助。

Depending on your OS you can do various things.

In a UNIX like environment you can write a program and use setuid or setguid so that it runs with priviledges of another (more priviledged) user.

Alternatively in Windows or UNIX you can run a service as the more priviledged user and let it take requests from other users/processes to carry out the operation on their behalf. You'd have to look into ways to communicate with the service.

Hope that helps.

笑饮青盏花 2024-08-19 21:34:19

最简单的方法可能是编写一个公开命名管道的服务,并创建一个与管道通信并向您的服务发出指令的客户端应用程序。该服务在 LocalSystem 或指定的较高权限帐户下运行,并执行在较低权限的用户帐户下运行的应用程序的指令。当您连接到管道时,您需要某种握手来建立真诚的关系,但这并不难做到。您可以使用 WCF 代替管道,但我认为在这种情况下您不会从中获得太多优势。

Probably the easiest way is to write a service which exposes a named pipe, and create a client application which talks to the pipe and issues instructions to your service. The service runs under LocalSystem or a nominated higher-privilege account, and carries out instructions from the app running under a user account with lower privilege. You'd need some sort of handshake to establish bona-fides when you connect to the pipe, but it's not hard to do. You could use WCF instead of pipes, but I don't think you get much advantage from that in this scenario.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文