ssh X11转发不起作用 [英] ssh X11 forwarding won't work

查看:153
本文介绍了ssh X11转发不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使X11端口转发能够从我的笔记本电脑上工作.我不知道为什么它不起作用.

I have been trying to get X11 port forwarding to work from my laptop. I can't figure out why it won't work.

当我尝试运行xterm时收到此消息:

I get this message when I try to run xterm:

X11 connection rejected because of wrong authentication.
xterm Xt error: Can't open display: localhost:10.0

我不知道这是否相关,但是当我登录时,我收到以下消息:

I don't know if this is related or not, but when I login, I get this message:

/usr/bin/xauth:  timeout in locking authority file /home/sphillips/.Xauthority

我想知道问题是否出在笔记本电脑上的本地用户是skp,而该服务器上的用户名是sphillips.我已经能够将X11转发与其他使用相同skp登录名的计算机一起使用.

I have wondered if the problem is that my local user on my laptop is skp and the username on this server is sphillips. I have been able to get X11 forwarding to work with my other computers that use the same skp login.

此外,X11端口转发从使用Xming和Putty的Windows机器到同一服务器.我必须手动将DISPLAY变量配置为IP地址并显示0.0,但是它可以工作.

Also, the X11 port forwarding works from a Windows machine using Xming and Putty to the same server. I have to manually configure the DISPLAY variable to the IP address and display 0.0, but it works.

我已经在计算机上运行了xhost +,试图绕过任何安全问题.仍然没有用.

I have run an xhost + on my machine with the attempt to try to bypass any security issues. That still didn't work.

在服务器上,我检查配置:

On the server, I check the configuration:

$ sudo grep X11Forwarding /etc/ssh/sshd_config
#X11Forwarding no
X11Forwarding yes
#   X11Forwarding no

在我的机器上:

$ sudo grep X11Forwarding /etc/ssh/sshd_config
[sudo] password for skp: 
#X11Forwarding no
X11Forwarding yes
#   X11Forwarding no

我的服务器是RedHat Enterprise Linux 6,笔记本电脑是Fedora 15.

My server is RedHat Enterprise Linux 6 and my laptop is Fedora 15.

谁能给我任何想法,以尝试使SSH X11转发到我的笔记本电脑上工作?

Can anyone give me any thoughts on things to try to get SSH X11 forwarding to work from my laptop?

推荐答案

我终于找到了答案(至少针对我的情况)!问题是SELinux.我关闭了SELinux,它没有问题.

I finally found the answer (at least for my situation)! The problem was SELinux. I turned off SELinux, and it worked with no problem.

如果您对所有详细信息感兴趣,可以在

If you interested in all of the gory details, you can read about it on my blog, but let me detail the pertinent facts here...

在远程计算机上,我使用dmesg查看日志消息:

On the remote machine, I used dmesg to view the logging messages:

dmesg | tail

我发现了许多这样的消息:

I found a number of messages like this:

type=1400 audit(1332520527.110:51337): avc: denied { read } for pid=25240 comm="sshd" name="authorized_keys" dev=dm-5 ino=167 scontext=unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:home_root_t:s0 tclass=file

您可以使用以下命令检查SELinux的状态:

You can check the status of SELinux with this command:

$ sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: permissive
Policy version: 24
Policy from config file: targeted

您可以使用以下命令将其设置为宽松模式:

You can turn it to permissive mode with this command:

setenforce 0

有关SELinux的更多信息,我发现红色帽子指南很有帮助.另外,对于其他SSH问题,我发现了 David的博客对帮助日志记录有所帮助.

For more information on SELinux, I found Red Hat's guide helpful. Also, for other SSH issues, I found David's blog helpful for getting logging to help.

对我来说,此后,我的X11转发开始正常工作.

For me, after that, my X11 forwarding started working with no problem.

SELinux阻止了其他几种不同的事情.它无法创建必要的文件以使密钥身份验证起作用.我还发现它阻止ssh-keygen在主目录中创建密钥.

SELinux was preventing several other different things. It could not create the necessary files to make key authentication work. I also found it blocking ssh-keygen from creating keys in the home directory.

这篇关于ssh X11转发不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆