博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
RHEL6上ssh -X打不开图形化窗口(Remote: No xauth program; cannot forward with spoofing.)
阅读量:4178 次
发布时间:2019-05-26

本文共 1789 字,大约阅读时间需要 5 分钟。

[root@localhost ~]#  lsb_release -a
LSB Version:    :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID:    RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 6.0 (Santiago)
Release:    6.0
Codename:    Santiago

254装了图形化,168默认没装图形化,254 ssh -X到168,发现打不开图形界面,发现原因竟是168上少装了一个xauth的包。

strace xhost发现报如下错:

strace xhost +
...
connect(3, {sa_family=AF_INET, sin_port=htons(6000), sin_addr=inet_addr("10.100.0.254")}, 16) = -1 ECONNREFUSED (Connection refused)

...

ssh -vvv发现是xauth的问题:
ssh 10.100.0.168 -X -vvv
...
debug3: Wrote 512 bytes for a total of 2005
debug1: Remote: No xauth program; cannot forward with spoofing.
debug2: channel_input_status_confirm: type 99 id 0
...

安装xauth:

yum install xauth -y

再次-X登陆,注意最后一行,xauth在用户家目录下创建了一个.Xauthority的文件:

[root@401x Desktop]# ssh 10.100.0.168 -X
root@10.100.0.168's password:
Last login: Sun Aug 19 21:05:08 2012 from 10.100.0.254
/usr/bin/xauth:  creating new authority file /root/.Xauthority

发现已经可以打开图形界面:

[root@localhost ~]# xclock

Warning: Missing charsets in String to FontSet conversion

回过头来看下ssh -vvv:

ssh 10.100.0.168 -X -vvv
...
debug3: Wrote 128 bytes for a total of 1381
debug2: callback start
debug2: x11_get_proto: /usr/bin/xauth  list :0.0 2>/dev/null
debug1: Requesting X11 forwarding with authentication spoofing.
debug2: channel 0: request x11-req confirm 0
...

原本以为是xhost和DISPLAY变量设置的问题,结果发现与二者没有任何关系。

装了xauth后,168上的DISPLAY如下,xhost和DISPLAY变量都未做任何改动。

[root@localhost ~]# echo $DISPLAY

localhost:10.0

REF:

1. xhost doesn't work

http://forums.gentoo.org/viewtopic-t-424675-start-0.html

2. No xauth Program; Cannot Forward With Spoofing Error and Solution

http://www.cyberciti.biz/faq/linux-unix-appleosx-noxauth-program-cannot-forward-with-spoofing/

转载地址:http://pjtai.baihongyu.com/

你可能感兴趣的文章
Android 的source (需安装 git repo)
查看>>
Ubuntu Navicat for MySQL安装以及破解方案
查看>>
java多线程中的join方法详解
查看>>
在C++中如何实现模板函数的外部调用
查看>>
HTML5学习之——HTML 5 拖放
查看>>
HTML5学习之——HTML 5 应用程序缓存
查看>>
HTML5学习之——HTML 5 Web Workers
查看>>
HTML5学习之——HTML 5 Canvas
查看>>
HTML5学习之——HTML5 内联 SVG
查看>>
HTML5学习之——HTML 5 服务器发送事件
查看>>
SVG学习之——HTML 页面中的 SVG
查看>>
SVG 形状学习之——SVG圆形
查看>>
SVG 滤镜学习之——SVG 滤镜
查看>>
mysql中用命令行复制表结构的方法
查看>>
hbase shell出现ERROR: org.apache.hadoop.hbase.ipc.ServerNotRunningYetException
查看>>
让代码变得更优雅-Lombok
查看>>
解决Rhythmbox乱码
查看>>
豆瓣爱问共享资料插件发布啦
查看>>
Ubuntu10.10 CAJView安装 读取nh\kdh\caj文件 成功
查看>>
kermit的安装和配置
查看>>