Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 基于VcXsrv主机的访问控制不工作_Windows_Xserver - Fatal编程技术网

Windows 基于VcXsrv主机的访问控制不工作

Windows 基于VcXsrv主机的访问控制不工作,windows,xserver,Windows,Xserver,internet上的所有VcXsrv示例都是在禁用访问控制的情况下运行,并使用“-ac”开关。但实际上我想打开基于主机的访问控制,但到目前为止还不起作用 首先,我使用-auth开关从名为pc1的windows 10 PC(最新版本/补丁)启动VcXsrv > "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -auth "C:\users\myname\hosts.txt&

internet上的所有VcXsrv示例都是在禁用访问控制的情况下运行,并使用“-ac”开关。但实际上我想打开基于主机的访问控制,但到目前为止还不起作用

首先,我使用-auth开关从名为pc1的windows 10 PC(最新版本/补丁)启动VcXsrv

> "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -auth "C:\users\myname\hosts.txt"
在hosts.txt中,我有以下内容,其中linux1是远程主机名

localhost
inet6:localhost
linux1
inet6:linux1
192.168.1.191
inet6:192.168.1.191
ip地址是linux1的

然而,当我从linux1启动xterm时,我得到了这个错误

linux1$ /usr/bin/xterm -display pc1:0
Authorization required, but no authorization protocol specified
/usr/bin/xterm: Xt error: Can't open display: pc1:0
从pc1开始,当我运行xhost时,没有提到我的远程主机或它的ip

C:\Program Files\VcXsrv>xhost
access control enabled, only authorized clients can connect
INET:pc1.mshome.net
LOCAL:
INET:pc1
INET6:pc1
因此,'-auth'似乎没有加载hosts.txt文件


任何人都可以分享一些想法吗?

因此
-auth
用于不同的身份验证/访问控制机制。要使用基于主机的访问控制,请在Windows 10 PC上运行与以下类似的命令:

xhost +inet:localhost
xhost +inet6:localhost
xhost +inet:linux1
xhost +inet6:linux1
xhost +inet:192.168.1.191
(但无需使用
inet6:
明确重复最后一行,因为这是一个IPv4地址。)


然后再次自行运行
xhost
。现在应显示新的主机名和IP地址。从他们中的任何一个连接到VcXsrv现在都可以正常工作。

Stephen,很抱歉我的回复太晚,感谢您关注这个老问题。我检查了我的旧笔记。在C:\Program Files\VcXsrv下手动运行xhost是可行的,但我的目标是避免每次重新启动计算机后都这样做。inet6注释很有帮助。我对这件事赞不绝口。