免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 7134 | 回复: 8
打印 上一主题 下一主题

ssh 连不上,帐号密码都发送了,netstat -an 看到连接已经建立,谁见过怎么回事 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-08 10:44 |只看该作者 |倒序浏览
[10:39:53] Version exchange initiated...
[10:39:53]      server: SSH-1.99-OpenSSH_3.9p1
[10:39:53]      client: SSH-2.0-libssh_1.3.4.2 2314 NetSarang Computer, Inc.
[10:39:53]      SSH2 is selected.
[10:39:53] Algorithm negotiation initiated...
[10:39:53]      key exchange: diffie-hellman-group1-sha1
[10:39:53]      host key: ssh-dss
[10:39:53]      outgoing encryption: aes128-cbc
[10:39:53]      incoming encryption: aes128-cbc
[10:39:53]      outgoing mac: hmac-sha1
[10:39:53]      incoming mac: hmac-sha1
[10:39:53]      outgoing compression: zlib
[10:39:53]      incoming compression: zlib
[10:39:53] Host authentication initiated...
[10:39:53]      Hostkey fingerprint:
[10:39:53]      ssh-dsa 1024 9c:ba:ea:93:7d:77:9c:9f:8e:f7:91:fa:f7:d9:bf:59
[10:39:53]      Accepted. Verifying host key...
[10:39:53]      Verified.
[10:39:53] User authentication initiated...
[10:39:54]      Sent user name 'root'.
[10:39:58]      Sent password.
[10:39:58]      Access granted.

WARNING! The remote SSH server rejected an X11 forwarding request. To enable X11 forwarding, you should modify the server's configuration file and restart it.

If you do not need X11 forwarding feature, clear the [Forward X11 connections to] check box in the SSH Advanced Options dialog box.




到这就停住了,防火墙没启用

论坛徽章:
0
2 [报告]
发表于 2008-05-08 14:02 |只看该作者
怎么没人给点意见阿,自己顶

论坛徽章:
0
3 [报告]
发表于 2008-05-08 16:49 |只看该作者
服务器端的log不能看吗?

论坛徽章:
0
4 [报告]
发表于 2008-05-08 17:45 |只看该作者

回复 #1 canmo0522 的帖子

WARNING! The remote SSH server rejected an X11 forwarding request. To enable X11 forwarding, you should modify the server's configuration file and restart it.

If you do not need X11 forwarding feature, clear the [Forward X11 connections to] check box in the SSH Advanced Options dialog box.

这已写的很清楚了

论坛徽章:
0
5 [报告]
发表于 2008-05-08 17:48 |只看该作者
没有ssh的log

论坛徽章:
0
6 [报告]
发表于 2008-05-08 17:50 |只看该作者

回复 #4 paub 的帖子

我看了.和 下面的没关系: 回复 #1 canmo0522 的帖子

WARNING! The remote SSH server rejected an X11 forwarding request. To enable X11 forwarding, you should modify the server's configuration file and restart it.

If you do not need X11 forwarding feature, clear the [Forward X11 connections to] check box in the SSH Advanced Options dialog box.

这已写的很清楚了



这仅仅是客户端是不是用X11,可以在客户端部启用这个。

论坛徽章:
0
7 [报告]
发表于 2008-05-08 17:58 |只看该作者
把syslogd启用了。这回找到ssh的log了
如下“:sshd[2715]:error:openpty:no such file or directory
sshd[2715]: eror: session_pty_req: session 0 alloc faild

论坛徽章:
0
8 [报告]
发表于 2008-05-09 09:09 |只看该作者
grep -i x11 /etc/ssh/sshd_config
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes

把转发改为no看看

论坛徽章:
0
9 [报告]
发表于 2008-05-09 17:15 |只看该作者
原帖由 canmo0522 于 2008-5-8 17:58 发表
把syslogd启用了。这回找到ssh的log了
如下“:sshd[2715]:error:openpty:no such file or directory
sshd[2715]: eror: session_pty_req: session 0 all ...


X11 forward 应该不是导致你出错所在,那是xshell这个软件把这个信息打了下而已,其他ssh客户端没有直接打这个信息。

问题应该是在 openpty 的错误, 我曾碰到好几次诡异的出错都是SELinux开着导致,所以LZ你先看看SELinux关了吗?关掉再试试?

Ref:
http://blog.chinaunix.net/u1/43047/showart_371372.html
http://www.patoche.org/LTT/kernel/00000172.html

在openssh源码中搜索openpty,发现在openpty函数中需要打开许多设备文件,如: /dev/ptmx, pt, /dev/ptc等,意识到是不是缺少了相应的设备文件,因为制作根文件系统时根据需要选择部分的设备文件,并没有添加完全。于是将所有的设备文件都添加进去


在网上搜索openpty,找到解决方法解决"sshd makes error 'openpty: No such file or directory"

- mknod /dev/ptmx c 5 2
      chmod 666 /dev/ptmx
      mkdir /dev/pts

- Add to /etc/fstab:
       none            /dev/pts        devpts        gid=5,mode=620    0 0     

(Note:  gid=5 is applicable for RedHat systems for which group "tty" has gid 5.  Adjust according to your distribution.  Use mode=600 if you want "mesg n" to be default.
- Mount /dev/pts

[ 本帖最后由 可可火山 于 2008-5-9 18:17 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP