如果不通过 SSH 隧道,是否不允许 VNC?

如果不通过 SSH 隧道,是否不允许 VNC?

如果连接不是通过 SSH 隧道,我该如何禁止 VNC?

答案1

尽管它没有明确列为选项vnc4server,但您应该能够将该-localhost选项传递给底层Xvnc进程。

man vncserver

   You can add Xvnc options at the command line. They will be added to the
   invocation of Xvnc without changes.

man Xvnc

   -localhost
          Only  allow connections from the same machine. Useful if you use
          SSH and want to stop non-SSH connections from any  other  hosts.
          See the guide to using VNC with SSH on the web site.

或者,您可以使用ufwiptables默认拒绝外部连接,仅打开选定的 SSH 端口。

相关内容