SecureCRT使用图形程序故障(root用户su登录oracle用户)

最近看一朋友机器上安装Xmanager之后,用SecureCRT登录后,在字符界面下就可以直接启动图形安装程序,随后自己尝试安装,却出现问题,现将解决方法描述如下:

一、安装了Xmanager软件,在客户端上开启了Xmanager - Passive 程序

二、SecureCRT的会话选项中--端口转发--远程/X11--里将转发X11数据包勾上

用root用户登录后运行xclock程序,能够正常弹出时钟界面。

随后切换到oracle用户

su - oracle

运行xclock,出错

Xlib: connection to "localhost:10.0" refused by server
Xlib: SSH gateway: X11 authentication failed.

返回root用户,运行xhost +(+中间有空格)

xhost +

access control disabled, clients can connect from any host

在次登录oracle用户,运行xclock,依然报错,像是没有权限,认证出错。

Xlib: connection to "localhost:10.0" refused by server
Xlib: SSH gateway: X11 authentication failed.

用baidu在网上寻找N篇文章,均未解决。

后在一英文网站上找到解决办法,文章如下:

 

Getting “Xlib: PuTTY X11 proxy: wrong authentication protocol attempted”? I have the answer :)

Here’s the scenario:

You ssh to a remote server with your login and either sudo or su to another user to run some application that uses a X Windows front end.  There is a firewall between your desktop and the remote server that allows only ssh connections (port 22).  When you run into the error “Xlib: PuTTY X11 proxy: wrong authentication protocol attempted”.  What to do?
ssh jason@remote-server -X
jason $ echo $DISPLAY
localhost:10.0
jason $ su – oracle
oracle‘s Password:
oracle $ xterm
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
xterm Xt error: Can’t open display: localhost:10.0

On recent OpenSSH Server releases, you can simply enable “ForwardX11Trusted yes” in the /etc/ssh/sshd_config file and restart the OpenSSH server.  If you’re not using a recent OpenSSH Server release or if you can’t for security or political reasons, what could you do? Give up? It’s simpler than you think.
You need to temporarily transfer the authorization to the other account. First, get the key from your account:
jason $ xauth list
aspc2o1/unix:10 MIT-MAGIC-COOKIE-1 bc334c66cfec3c5c3d5b0efc4ee9d3ad

Next, sudo/su to the other account and add the authorization key.
jason $ su – oracle
oracle $ xauth add aspc2o1/unix:10 MIT-MAGIC-COOKIE-1 bc334c66cfec3c5c3d5b0efc4ee9d3ad

Now, you should be able to start any X Windows application, assuming that your DISPLAY variable is set to go through the ssh tunnel:
oracle $ xterm

 

按上述解决思路,先在root用户下
xauth list
test/unix:0  MIT-MAGIC-COOKIE-1  c9b6fb154e27f4502bb7a2567f80be94
test:0  MIT-MAGIC-COOKIE-1  c9b6fb154e27f4502bb7a2567f80be94
test/unix:10  MIT-MAGIC-COOKIE-1  e159d383446bb081235e5203910f343b
切换到oracle用户下
xauth list
test/unix:10  MIT-MAGIC-COOKIE-1  0b608e65c9794e764c5bc3bf8e6bf9a0
test/unix:11  MIT-MAGIC-COOKIE-1  783e33c44cdeaa491b3694539d556faf
发现test/unix:10后面的那串认证码和root下看到的不一样,修改一下
xauth add MIT-MAGIC-COOKIE-1  e159d383446bb081235e5203910f343b
之后在xauth list,发现一致了
test/unix:10  MIT-MAGIC-COOKIE-1  e159d383446bb081235e5203910f343b
test/unix:11  MIT-MAGIC-COOKIE-1  783e33c44cdeaa491b3694539d556faf
之后在运行xclock或dbca都正常了

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章