远程关闭显示输出?

Naf*_*Kay 5 ssh xorg vnc

我正在使用x11vnc和 SSH 将 VNC 远程隧道连接到我的本地机器。

这样做的一个有趣的副作用是,当我在家使用我的工作计算机时,我的同事会看到我在鼠标、打字等周围移动,并且可以站在办公室的计算机旁观看一切。

有没有办法让我远程禁用显示输出,但仍然可以在我离开时将 VNC 进入我的实际桌面?优选地,在会话期间停止键盘和鼠标输入将是一个好主意™。

slm*_*slm 7

您应该能够使用xrandr关闭给定的显示。

$ xrandr --output CRT1 --off
Run Code Online (Sandbox Code Playgroud)

要重新启用它:

$ xrandr --output CRT1 --auto
Run Code Online (Sandbox Code Playgroud)

您可以使用xrandr -q以下命令查看输出显示的名称:

$ xrandr -q
Screen 0: minimum 320 x 200, current 1440 x 900, maximum 8192 x 8192
LVDS1 connected primary 1440x900+0+0 (normal left inverted right x axis y axis) 303mm x 190mm
   1440x900       60.0*+   50.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)
Run Code Online (Sandbox Code Playgroud)

参考