14

我通过运行如下代码通过 SSH 连接到服务器:

ssh serverUser@serverIP "./runServer" &

当我在客户端启动 VM 并在其上编写 startX 时,在脚本的下一行,它说:X Error of failed request: Bad Window.

查找此错误后,我通过使用“Y”转发来解决此问题。

ssh -Y serverUser@serverIP "./runServer" &

我无法理解 X 和 Y 转发是否是相同的概念 - 有多少这样的 X、YZ 转发是可能的?

谢谢。

4

1 回答 1

20

从手册页:

 -X      Enables X11 forwarding.  This can also be specified on a per-host
         basis in a configuration file.

         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      Enables trusted X11 forwarding.  Trusted X11 forwardings are not
         subjected to the X11 SECURITY extension controls.

另请参阅:https ://askubuntu.com/questions/35512/difference-between-ssh-y-and-ssh-x

于 2012-11-17T00:36:18.713 回答