使用macbook ssh连接到linux服务器, 并开启图形界面转发

问题场景

希望在macbook上查看linux服务器的图形, 例如使用feh命令或者

cv2.imshow()

等情形. 如果没正确配置则会报错:

feh ERROR: Can't open X display. It *is* running, yeah?

配置

sudo vim /etc/ssh/ssh_config
# 修改文件内容为
Host *
  ForwardAgent yes
  ForwardX11 yes
  • 在remote机器(X11 forward xclient)上编辑文件
sudo vim /etc/ssh/ssh_config
# 修改文件内容为
X11Forwarding yes
原文地址:https://www.cnblogs.com/theodoric008/p/13288570.html