xshell打开GUI程序失败

xshell中执行GUI程序时会自动运行Xmanager,并在客户端机器显示GUI程序的图形界面。但使用su - xiao切换用户后,执行GUI程序报错:Connection lost to X server `localhost:10.0';xshell直接登录用户xiao则能够正常显示。查看环境变量DISPLAY,两种情况下都是localhost:10.0。

 

新建文件 /root/.xauth/export,内容为用户名xiao,问题解决。

 

问题解析:

-------------------------

The message above is received when X application fails to connect to PC X server, Xmanager.

The common reasons that may cause connection failure to PC X server are the following:

1. PC X server is not installed: After installing Xmanager, set "Forward X11 connections to Xmanager"(Properties -> Tunneling -> X11 Forwarding).

2. When switched to a different user using su command, X11 authentication cookie cannot be accessed.

 

-------------------------

 

The authority is propagated. Once you switch user to root s broken and you must manually create the xauthority. This behaviour is controlled by pam_xauth, and apparently you can make it automatic for root to forward the xauth key to a user by creating a file /root/.xauth/export and adding the allowed users to it, see
http://www.kernel.org/pub/linux/libs...pam_xauth.html

 

参考:

http://www.netsarang.com/bbs/detail.html?id=xshell&num=151

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值