通过cygwin openssh执行时拒绝访问

通过cygwin openssh执行时拒绝访问,ssh,permissions,cygwin,Ssh,Permissions,Cygwin,当我通过远程windows计算机上的ssh终端执行命令“iisreset”时,会出现以下错误: Attempting stop... Restart attempt failed. Access denied, you must be an administrator of the remote computer to use this command. Either have your account added to the administrator local group of the

当我通过远程windows计算机上的ssh终端执行命令“iisreset”时,会出现以下错误:

Attempting stop...
Restart attempt failed.
Access denied, you must be an administrator of the remote computer to use this
command. Either have your account added to the administrator local group of
the remote computer or to the domain administrator global group.
当我输入whoami时,它显示我是管理员。我的cygwin ssh会话以具有管理员权限的“cyg_服务器”用户身份运行。 我的ssh服务器配置了权限分离,允许我以管理员身份登录。 当我在本地运行该命令时,它工作正常。问题是通过ssh执行。 我还使用了process monitor来查看发生了什么,但它并没有指出问题所在

这非常奇怪,因为我能够在远程ssh中执行仅限管理员的操作,例如:

echo "hi">/cygdrive/c/x.txt
rm /cygdrive/c/x.txt
关闭UAC并没有什么不同。
有什么想法吗?

我遇到了一个类似的问题:无法从远程无密码(公钥/私钥)SSH用户使用net start/net stop启动/停止服务。试图启动/停止服务导致“系统错误5已发生。访问被拒绝。”错误)

我必须安装Cygwin的LSA身份验证包(请参阅),以便(我想)setuid能够在无密码登录时正常工作


一旦在Cygwin/SSH主机上安装LSA并重新启动机器,问题就会消失。

我害怕@user3609241的答案中提到的LSA包,因为LSA文档中有这样一句话:

一旦LSA遇到严重问题(例如 受保护的LSA进程死机),它会触发系统重新启动

但是,这些文档指出了一种非常简单的“runas”系统方法——只需使用
at
命令:

$ date
Mon, Jan 12, 2015  8:17:35 PM

$ at 20:18 iisreset
Added a new job with job ID = 1

$ at
Status ID   Day                     Time          Command Line
-------------------------------------------------------------------------------
                1   Today                   8:18 PM       iisreset
它可以工作,但代价是必须等待59秒


(将上述命令序列包装在一个易于调用的脚本中,留给读者作为练习;我们的管理util是用Perl编写的,因此非常简单)。

以管理员身份运行Cygwin终端

使用pwd auth over SSH(ugh)也可以根据以下旧线程工作:。我很高兴尝试LSA套餐,谢谢你的提示。