不能使用xterm

shell> su - mysql

shell> xterm

Xlib: connection to ":0.0" refused by server

Xlib: No protocol specified

xterm Xt error: Can't open display :0.0

这个问题该如何解决呢?

1.用root登陆
2.执行xhost +
3.su - mysql

现在就可以执行xterm了;

以下是man xhost的部分解释:

The  xhost  program  is  used  to add and delete host names or user names to the list allowed to make connections to the X
       server.  In the case of hosts, this provides a rudimentary form. of privacy control and security.  It  is  only  sufficient
       for  a  workstation  (single  user) environment, although it does limit the worst abuses.  Environments which require more
       sophisticated measures should implement the user-based mechanism or use the  hooks  in  the  protocol  for  passing  other
       authentication data to the server.

以下信息摘抄自别人blog, 并没有全部验证,

xhost + 是使所有用户都能访问Xserver.
xhost + ip使ip上的用户能够访问Xserver.
xhost + nis:user@domain使domain上的nis用户user能够访问
xhost + inet:user@domain使domain上的inet用户能够访问。

上面的操作在本机挺好的;

但是如果想要访问远程机器的xterm, 那么就有些麻烦了;

1) ssh -X root@remote_server_ip; 这里-X一定需要,什么作用,去查ssh --help

2) 在当前用户下, 需要有.Xauthority文件,并且这个文件的owner:group需要是自己;

知道了觉得也不难, 不知道的时候觉得非常痛苦..

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7682812/viewspace-668366/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7682812/viewspace-668366/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值