以用户身份运行程序,但具有更高的特权 [英] Run a program as user identity but with elevated privileges

查看:113
本文介绍了以用户身份运行程序,但具有更高的特权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景:

管理员将安装该应用程序。该应用程序具有一些内核级别的操作,因此,它必须以特权模式运行。但是用户没有管理员凭据才能以提升模式运行应用程序。

An administrator will install the application. The application has some kernel level operations so, it has to run with privileged mode. But the user does not have administrator credentials to run the application in elevated mode.

那么,解决上述情况的最佳可能性是什么?

So, what are the best possibility to solve the above scenario.

解决方案一(尝试过):
通过管理员安装应用程序时,我们将在知道他的用户名和密码的情况下创建一个管理员。因此,当用户尝试执行任何操作时,我们将使用c#中的processstartinfo()和process.start()函数以提升模式运行应用程序。但是,该应用程序以管理员名称运行,因此该用户的映射驱动器不可见,因为该管理员不在ACL列表中。因此,这种方法已被排除在外。

Solution one (tried): While installing the application through administrator, we would create an admin where we know his user name and password. So, when the user tries to perform any operation, we will run the application as elevated mode using the functions processstartinfo() and process.start() in c#. But, the application runs in admin name, so the mapped drives for the user are not visible as this admin is not in the ACL list. So, this method is getting ruled out.

在使用c#应用程序完成操作之前,可以提高用户自己作为管理员的解决方案吗?

Can there be a solution where elevating the user it self as admin till the operation is completed using c# application?

我被困住了,没有找到任何值得阅读的文章。

I'm stuck and I don't find any articles to read upon on this.

编辑:
在企业级别,Windows不会要求使用BitLocker的管理员身份。因此,我们要实现相同类型的功能。

Edit : At an enterprise level, the windows doesn't ask for admin creds for using bitlocker. So, we want to achieve the same type of functionality.

有可能吗?

有人可以帮忙吗? ?

谢谢。

推荐答案

我所做的解决方案是将程序分为两部分。一部分作为使用管理员特权运行的服务运行,另一部分使用普通特权运行。
这两个程序之间的通信可以通过以太网或共享内存运行。

The solution that I did was to separate the program into two parts. One part runs as a service that is run using admin privileges and the other part runs using normal privileges. The communication between the two programs can run via Ethernet or using shared memory.

这篇关于以用户身份运行程序,但具有更高的特权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆