ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 不能使用xterm

不能使用xterm

原创 Linux操作系统 作者:gates_gp 时间:2010-07-19 11:19:23 0 删除 编辑

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博客 ” ,链接:https://blog.itpub.net/7682812/viewspace-668366/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: mysql源码安装
下一篇: gdb使用介绍
请登录后发表评论 登录
全部评论

注册时间:2010-07-18

  • 博文量
    24
  • 访问量
    32607