连接远程服务器
MobaXterm连接远程服务器,X11-Forwarding显示服务器禁用

操作系统中安装X11相关安装包
yum install -y xorg-x11-xauth xorg-x11-fonts-* xorg-x11-font-utils xorg-x11-fonts-Type1 xclock

修改配置文件
修改/etc/ssh/sshd_config配置文件
vi /etc/ssh/sshd_config
# 部分内容如下:
...
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes #将X11Forwarding去掉注释改为yes
#X11DisplayOffset 10
X11UseLocalhost no #将X11UseLocalhost去掉注释改为no
#PermitTTY yes
#PrintMotd yes
...

重启ssh服务
# linux6:
service sshd restart
# linux7:
systemctl restart sshd.service

编辑或者新建session,勾选X11-Forwarding

连接session,会发现欢迎界面的变化

执行xclock测试能否调用出虚拟机gui界面

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




