网上的教程都差不多,但基本都没说要重启才能生效,所以特别发出来强调下,执行sudo /etc/init.d/openbsd-inetd start后要重启才能netstat -l看见echo等服务
其他操作如下没区别
1.安装openbsd-inetd
sudo apt-get install openbsd-inetd
2.配置。打开文件/etc/inetd.conf,去年注释可以打开相应服务,也可以添加不存在的服务
...
#:INTERNAL: Internal services
#discard stream tcp nowait root internal
#discard dgram udp wait root internal
daytime stream tcp nowait root internal
#time stream tcp nowait root internal
echo stream tcp nowait root internal
#:STANDARD: These are standard services.
...
3.启动服务
sudo /etc/init.d/openbsd-inetd start
4.查看服务是否启动
gavin@ubuntu:~$ netstat -l
激活Internet连接 (仅服务器)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:echo *:* LISTEN
tcp 0 0 *:daytime *:* LISTEN
tcp 0 0 localhost:ipp *:* LISTEN
gavin@ubuntu:~$ netstat -ln
激活Internet连接 (仅服务器)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:7 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:13 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
可以看到echo,daytime两个服务均处于监听状态了。
5.使用netcat测试,如下
C:\Users\Administrator>nc 192.168.1.181 13
Thu May 31 02:33:02 2012
C:\Users\Administrator>nc 192.168.1.181 7
hello gavin
hello gavin