原来一直认为ssh仅仅是一个字符界面,最近发现其实可以传输xserver中的图像。
方法很简单,只需要在ssh的选项中添加-Y
就可以了。比如原来的ssh命令是这样:
ssh ubuntu@localhost
现在改成这样
ssh -Y ubuntu@localhost
非常简单有效。
另外,远程查看Ubuntu中的图像,可以使用eog
命令。安装:
sudo apt install eog
安装完成后,直接运行eog ./test.png
即可。这对于服务器调试相当方便了!
SSH 可选的加速策略
-C Requests compression of all data (including stdin, stdout,
stderr, and data for forwarded X11 and TCP connections). The
compression algorithm is the same used by gzip(1), and the
“level” can be controlled by the CompressionLevel option for pro-
tocol version 1. Compression is desirable on modem lines and
other slow connections, but will only slow down things on fast
networks. The default value can be set on a host-by-host basis
in the configuration files; see the Compression option.