免费注册 查看新帖 |

Chinaunix

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

solaris 10 ssh与tcp_wrappers的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-07-29 13:09 |只看该作者 |倒序浏览
一台SOLARIS 10,版本5.10 Generic_139555-08\r\n\r\n安装了TCP_WRAPPERS,现在发现一个问题:\r\n如果/etc/hosts.deny中是ALL:ALLENY,那么ssh的时候就报\r\n$ ssh dls00209@10.18.4.150\r\nssh_exchange_identification: Connection closed by remote host\r\n\r\n如果注释了ALL:ALLENY,就正常可以使用ssh\r\n\r\n/etc/hosts.allow中是\r\nsshd:192.168.0.30:allow\r\n\r\n要同时使用tcp_wrappers和ssh,到底该怎么办???

论坛徽章:
0
2 [报告]
发表于 2009-07-29 13:30 |只看该作者
在/etc/hosts.allow中写入sshd启动的绝对路径\r\n\r\n比如:\r\n/usr/local/bin/sshd:192.168.0.30:allow\r\n\r\n\r\nsolaris10可能路径是:\r\n/usr/lib/ssh/sshd:192.168.0.30:allow\n\n[ 本帖最后由 easybegin 于 2009-7-29 14:05 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2009-07-29 14:07 |只看该作者

回复 #1 xuguopeng 的帖子

花了两个星期。\r\n终于搞定ssh_exchange_identification: Connection closed by remote host \r\n\r\n走了许多弯路。\r\n写解决方法 \r\n主要是 /etc/hosts.allow 和 /etc/hosts.deny问题 最好两个都设置一下。\r\n因为有些系统是先load hosts.allow 再 load hosts.allow .有些相反。 \r\nhosts.allow: \r\nALL:ALL:allow sshd sshd1 sshd2:ALL:allow #ssh:0.0.0.0/0.0.0.0 sshd:192.168.1.:allow hosts.deny sshd[2760]: \r\n# you should know that NFS uses portmap!\r\nALL:ALL EXCEPT 127.0.0.1ENY to ALL:ALL EXCEPT 127.0.0.1 AND 192.168.1.111ENY\r\n\r\n完成后。重启sshd :\r\nservice sshd restart     /etc/init.d/sshd restart\r\n\r\n如果还不行就查一下syslog\r\n\r\n位置在 /var/log/syslog\r\n在那可以看到为什么不行。再改一下。再测试一下。反正都要多试几种方法\r\n....\r\n....refused connect from ::ffff:192.168.*.*...\r\n.........\r\n\r\n上个星期去 google查的时候发再外国有位仁兄,超搞笑。他出现这个问题后。也搞了很久,但是还不行。然后他就不想理它了,出去玩。回来后就可以连接上了。于是我想我也把网线拔了。等了两天发现还是不行啊。所以说外国的经验还是不能照套的。\r\n\r\n我在想,上baidu找一下吧,发现只有提问的。没有回答的。百度知道根本都没有这个问题。只能上google了,还好,找到了一些眉目,于是就尝试锁定hosts。全英对我没有什么问题,外语大学的嘛,找找看。设置一下,\r\n发现sshd_conf是没问题的。\r\n记得重点放要在hosts.allow和hosts.deny那。\r\n\r\n并且log日志很重要的。所以我也看了大半天的网上日志资料。(用google查)\r\n\r\n文章出处:http://www.diybl.com/course/6_sy ... s/200798/70589.html

论坛徽章:
0
4 [报告]
发表于 2009-07-29 14:12 |只看该作者
试过楼上说的了,不行,没效果

论坛徽章:
0
5 [报告]
发表于 2009-07-29 14:46 |只看该作者
彻底郁闷了。。。。\r\n在hosts.deny中写成 sshd:all:deny,hosts.allow中sshd:192.168.30:allow,也无法连接。\r\n把hosts.deny清空,连接成功~~ 兴奋~~~~~\r\n然后把hosts.allow清空,依然可以连接。。。。。。。我日~~~ \r\n\r\n我搞不清楚到底是hosts.allow优先还是hosts.deny优先了。。。。。。。。。。疯了

论坛徽章:
0
6 [报告]
发表于 2009-07-29 14:50 |只看该作者

回复 #6 xuguopeng 的帖子

查了一下,的确是hosts.deny优先

论坛徽章:
0
7 [报告]
发表于 2009-07-29 14:58 |只看该作者
迷糊了。。。。。\r\n\r\n如果在hosts.deny中ALL:ALL EXCEPT 127.0.0.1 AND 192.168.0.30ENY 用ssh就可以连上了,貌似hosts.allow没什么用了。。。。。\r\n但在hosts.allow中如果写\r\nin.telnetd:192.168.0.11:allow\r\n在192.168.0.11可以使用telnet连接,如果再加上sshd:192.168.0.11:allow,可以使用telnet但用ssh不行。。。。\r\n\r\n这都什么啊~~~~~~~~~~~~~~~~~~~~~~~

论坛徽章:
0
8 [报告]
发表于 2009-07-29 15:40 |只看该作者
系统日志里有这样的错误\r\n\r\nsshd[14753]: [ID 800047 auth.crit] fatal: matching cipher is not supported: aes256-cbc\r\n\r\n\r\n这个是啥意思?

论坛徽章:
0
9 [报告]
发表于 2009-07-29 15:44 |只看该作者

论坛徽章:
7
荣誉会员
日期:2011-11-23 16:44:17水瓶座
日期:2013-08-28 21:20:16丑牛
日期:2013-10-02 21:01:462015年迎新春徽章
日期:2015-03-04 09:54:45操作系统版块每日发帖之星
日期:2016-06-05 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-20 08:24:0515-16赛季CBA联赛之四川
日期:2016-08-18 15:02:02
10 [报告]
发表于 2009-07-29 15:48 |只看该作者
暂时把/etc/hosts.allow /etc/hosts.deny移走,然后看看ssh可否使用,把问题分离出来,初步解决。我认为2楼的思路没错
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP