Xlib: Invalid MIT-MAGIC-COOKIE-1 key 解决方法

简介:
使用VNC工具连接服务器,使用图形界面方式安装oracle时,grid 用户执行./runInstaller 后报错,提示说明缺少/etc/bin/xplayinfo 命令文件,
但是网上的资料解决问题时,以root身份执行xhost + 时又报如下错误:
Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
Can't open display named
当前的情况是: 当前用户为root(报上面的错误信息),而且用户grid以vnc登录了, 上面的错误的原因是用户grid不允许打开一个root控制的窗口。如果root 用户想要让其他用户使用窗口,就要执行 xhost +localhost 以便将其他用户加入访问列表。这里我的问题是由于 /etc/sysconfig/vncserver 文件里面内容为
VNCSERVERS= "1:root  2:oracle  4:grid"
VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERARGS[2]="-geometry 1024x768"
VNCSERVERARGS[4]="-geometry 1024x768"
但是 实际上我以grid身份使用vnc连接系统时使用的是ip:1 (正确的应该是 ip:4),从配置文件来看 1 是由root来控制的。所以会报开始的错误。
解决办法是
在grid 用户下
关闭vnc 连接
grid@rac1:/home/grid>vncserver -kill :1
Killing Xvnc process ID 29019
在root用户下
root@rac1#/etc/init.d/vncserver stop
再次启动
root@rac1#vncserver
New 'rac1: 1 (root)' desktop is rac1:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/rac1:1.log  
在grid 用户下
重新启动
New 'rac1: 2 (grid)' desktop is rac1:2
Starting applications specified in /home/grid/.vnc/xstartup
Log file is /home/grid/.vnc/rac1:2.log
在oracle 用户下(以后会使用oracle 安装oracle数据库软件)
oracle@rac1$vncserver
New 'rac1: 3 (oracle)' desktop is rac1:3
Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/rac1:3.log  
最后配置/etc/sysconfig/vncserver 文件里面内容为
VNCSERVERS=" 1:root 2:grid 3:oracle"
VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERARGS[2]="-geometry 1024x768"
VNCSERVERARGS[3]="-geometry 1024x768"
再次连接vnc 的方式是:
root用户     ip:1
grid用户     ip:2
oracle 用户  ip:3
至此问题解决了。如果你的问题也出现了Xlib: Invalid MIT-MAGIC-COOKIE-1 key ,那很可能与我的案例一样。仅供参考了。 
相关文章
eggjs 项目报错 Cookie need secret key to sign and encrypt. Please set config.keys first
eggjs 项目报错 Cookie need secret key to sign and encrypt. Please set config.keys first
289 0
eggjs 项目报错 Cookie need secret key to sign and encrypt. Please set config.keys first
|
2月前
|
Java 应用服务中间件 nginx
【Azure 环境】Azure应用程序网关设置set_Cookie=key=value; SameSite=Strict; HTTPOnly,AzureAD登录使用cookie时使用不了的案例记录
【Azure 环境】Azure应用程序网关设置set_Cookie=key=value; SameSite=Strict; HTTPOnly,AzureAD登录使用cookie时使用不了的案例记录
|
2月前
Error unprotecting the session cookie.The key {...} was not found in the key ring.
Error unprotecting the session cookie.The key {...} was not found in the key ring.
55 0
electron升级到20版本后,禁用第三方cookie、跨域问题解决方法
electron升级到20版本后,禁用第三方cookie、跨域问题解决方法
381 0
|
存储 iOS开发
iOS wkwebview嵌入优酷视频,显示“请允许cookie存储”解决方法
iOS wkwebview嵌入优酷视频,显示“请允许cookie存储”解决方法
592 0
|
PHP 数据库 数据安全/隐私保护
invalid cookie header httpclient
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qingfeng812/article/details/60584081 ...
1525 0
|
C# Windows
C# .net中cookie值为中文时的乱码解决方法
一.cookie的名称或子cookie的名称不能为中文,否则无法获得cookie 这个好办,名称不用中文即可 二.cookie的值为中文时候,取cookie的值会出现乱码 解决办法:存取cookie时候先解码和编码 存cookie,进行编码: cookie.
1157 0