本教程只针对ubuntu
step 1:如果没安装x11服务:
参考下面的教程
software installation - How to install X11/xorg? - Ask Ubuntu
step 2:修改vim /etc/ssh/ssh_config
参考下面教程:
linux - How does mobaXterm know whether x11 forwarding is working on remote server? - Stack Overflow
step 3:重启ssh
service ssh restart
完事,打开一个新的终端连上远程会发现X11-forwarding生效了。