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/
1897

被折叠的 条评论
为什么被折叠?



