CentOS6通过ssh x11 forwarding远程执行GUI程序

CentOS 通过ssh x11 forwarding远程执行GUI程序:

一、服务器端的配置

1.1. 配置服务器的sshd

# vim /etc/ssh/sshd_config
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost ye

1.2、安装相关的依赖 ,重启sshd服务

# sudo yum install xorg-x11-xauth xorg-x11-fonts-* xorg-x11-font-utils xorg-x11-fonts-Type1 xclock
# service sshd restart

 二、客户端配置

2.1、用putty+Xming完成远程执行GUI程序

2.1.1安装Xming
      下载并安装Xming,地址:Xming - Download
 2.1.2.配置Xming
     通过XLaunch来完成启动,在托盘区会出现一个“X”形状的图标,这表示Xming已经在运行了,将鼠标悬停上去,能看到当前使用的“Display number”,默认是的0。


2.1.3.配置Putty
     运行PuTTY,在配置界面,选择“Connection->SSh->X11”,选中“Enable X11forwarding”,“X display location”中填上上一步中“Display number”中的数字(此处就是“localhost:0”)。


  连接登录远程主机后,运行命令xclock,弹出一个图形界面的时钟表示能正常执行GUI程序。

2.2、用MobaXterm 完成远程执行GUI程序

2.2.1下载并安装 MobaXterm

https://pan.baidu.com/s/1eS5xdYU

2.2.2远程连接服务器

"X11-forwarding" 和" DISPLAY" 两项都打上了绿色的勾,表示设置成功了。

连接登录远程主机后,运行命令xclock,弹出一个图形界面的时钟表示能正常执行GUI程序

三、其他问题

问题1:出现

“Failed to launch bus: Failed to connect to session busprocess 2182: D-Bus librar                   y appears to be incorrectly set up; failed to read machine uuid: Failed to open                    "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
  D-Bus not built with -rdynamic so unable to print a backtrace
Redirecting call to abort() to mozalloc_abort”的问题

解决方法:

# yum install dbus-x11
# dbus-uuidgen >/var/lib/dbus/machine-id

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

司马沉潇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值