如何通过 SSH 连接打开并查看图像文件?

Alv*_*oAV 4 ssh image-viewers

我正在使用什么

  • 乌班图14.04
  • 与另一台 Ubuntu 14.04 机器的 SSH 连接

我正在尝试做什么

  • 从控制台查看/显示图像的内容(.png.jpeg、 ...)。.bmp

我正在使用 Ubuntu 连接到 VPS,我需要知道图像文件在更新后是否发生变化,因此我需要通过 ssh 打开/显示图片。

我怎样才能做到这一点?

ter*_*don 5

如果您想使用 GUI 应用程序ssh,则需要使用-X-Y选项(使用-Y):

 -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.
Run Code Online (Sandbox Code Playgroud)

因此,例如,要用于eog在 处显示远程图像/path/to/file.png,您可以这样做

ssh -Y liarez@remote.host eog /path/to/file.png
Run Code Online (Sandbox Code Playgroud)