免费注册 查看新帖 |

Chinaunix

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

请问怎么样把ssh从standalone转换成xinetd [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-09-21 17:48 |只看该作者 |倒序浏览
请问openssh默认的启动方式是standalone吗,如果想将其转换成xinetd方式启动,应该要变动哪些地方呢?如果换成xinetd启动后再用service sshd start等同时用对SSH有影响吗?谢谢。

论坛徽章:
0
2 [报告]
发表于 2006-09-21 23:21 |只看该作者
原帖由 wlacf 于 2006-9-21 17:48 发表
请问openssh默认的启动方式是standalone吗,如果想将其转换成xinetd方式启动,应该要变动哪些地方呢?


  1. cat /etc/xinetd.d/sshd-xinetd
  2. # default: off
  3. # description: sshd server, xinetd version. \
  4. # Don't run the standalone version if you run \
  5. # this.
  6. service ssh
  7. {
  8.         disable = yes
  9.         socket_type             = stream
  10.         wait                    = no
  11.         user                    = root
  12.         server                  = /usr/sbin/sshd
  13.         server_args             = -i
  14.         log_on_success          += DURATION USERID
  15.         log_on_failure          += USERID
  16.         nice                    = 10
  17. }
复制代码


你需要先设定你原本 standalone sshd 服务停止执行,并设定每次开机不启动,后续即可改用 xinetd 启动之。

如果换成xinetd启动后再用service sshd start等同时用对SSH有影响吗?谢谢。


用 xinetd 了,你在也不可以使用 service sshd start,因为后续都是由 xinetd listen port 22。

==

论坛徽章:
0
3 [报告]
发表于 2006-09-22 11:15 |只看该作者
那我系统这个目录下没有这个文件/etc/xinetd.d/sshd-xinetd,是不是要手动创建啊,还有设定原本 standalone sshd 服务停止执行,用service sshd stop行吗,还是用别的方法停止?设定每次开机不启动是这样子吗?chkconfig --level 0123456 sshd off 本人刚学,愚蠢了点,望见谅。呵呵。这样改完后,不用改原来sshd_config的配置文件吗?因为原来的配置文件好像没有启动方式这项,不像别的比如proftpd等有这个选项可选的。如果是这样的话,那原来的standalone启动方式是在哪里设置的呢?谢谢。

论坛徽章:
0
4 [报告]
发表于 2006-09-22 11:54 |只看该作者
原帖由 wlacf 于 2006-9-22 11:15 发表
那我系统这个目录下没有这个文件/etc/xinetd.d/sshd-xinetd,是不是要手动创建啊


yes...

还有设定原本 standalone sshd 服务停止执行,用service sshd stop行吗,还是用别的方法停止?


yes... or /etc/init.d/sshd stop

设定每次开机不启动是这样子吗?chkconfig --level 0123456 sshd off


yes... rh-based 系统是可以使用 chkconfig。

不过你用 chkconfig sshd off 就可以了

这样改完后,不用改原来sshd_config的配置文件吗?因为原来的配置文件好像没有启动方式这项,不像别的比如 proftpd等有这个选项可选的。如果是这样的话,那原来的standalone启动方式是在哪里设置的呢?谢谢。


sshd 启动传入 -i 就是使用 inetd/xinetd 方式启动运作之。


  1. man sshd

  2.      -i      Specifies that sshd is being run from inetd(8).  sshd is normally
  3.              not run from inetd because it needs to generate the server key
  4.              before it can respond to the client, and this may take tens of
  5.              seconds.  Clients would have to wait too long if the key was
  6.              regenerated every time.  However, with small key sizes (e.g.,
  7.              512) using sshd from inetd may be feasible.

复制代码


还有,其实 sshd 不要放 xinetd 启动,因为通常实在没这个必要。

==

论坛徽章:
0
5 [报告]
发表于 2006-09-22 12:02 |只看该作者
讲得实在是太好了,对我非常有用,万分感激。谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP