gpt4 book ai didi

python - 无法在 Google 虚拟机 SSH 终端中打开 .py 文件

转载 作者:太空宇宙 更新时间:2023-11-03 17:20:02 25 4
gpt4 key购买 nike

我无法通过 Google VM SSH 控制台打开 .py 文件。 Kwrite 和 sudo apt-get install xvfb 已安装。

我的命令:

kwrite 测试.py

我收到以下错误:

kwrite:无法连接到 X 服务器。

我需要更改命令/安装其他软件吗?

谢谢

最佳答案

X-Windows(现在的 X11)是一种客户端-服务器架构。您可以使用 ssh 的 -X(大写)选项将连接转发到您的 x 服务器(即 $ ssh -X username@server.com)。如果服务器上的所有内容都正确安装,这应该可以工作(apt-get 通常在这方面做得很好,但我对 kwrite 没有太多经验)。

编辑

来自 ssh 手册页

X11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the user's X authorization database) can access the local X11 display through the forwarded connection. An attacker may then be able to perform activities such as keystroke monitoring.

For this reason, X11 forwarding is subjected to X11 SECURITY extension restrictions by default. Please refer to the ssh -Y option and the ForwardX11Trusted directive in ssh_config(5) for more information.

以及相关的-Y

-Y Enables trusted X11 forwarding. Trusted X11 forwardings are not subjected to the X11 SECURITY extension controls.

关于python - 无法在 Google 虚拟机 SSH 终端中打开 .py 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33264119/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com