解决unix网络编程(第三版)的源代码编译的问题 -connect dennied

在Ubuntu系统中,遇到使用daytime服务时出现connect denied错误时,需要安装xinetd并启用daytime和echo服务。通过编辑配置文件将disable选项从yes改为no,并重新加载xinetd配置来解决此问题。此外,可限制服务访问权限,只允许特定地址连接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

到官方网站下载源代码,先看readme.里头教你怎么做的.

如果你用ubuntu的话,在测试课本第5页的程序时,可能会遇到一个情况,connect dennied.

那是因为你的daytime服务没有开。

具体解决方案在
http://ubuntuforums.org/showthread.php?t=650791


摘录如下:
First, you'll need to install xinetd:
Code:
sudo aptitude install xinetd
Next you'll need to enable the daytime and echo services by editing their config files
in /etc/xinetd.d (you should only need to change the disable option from yes to no )

Finally tell xinetd to reload the configuration:
Code:
sudo invoke-rc.d xinetd reload
Note that by default, anyone will be able to connect to these services. You can (if you want),
restrict access to only allow connections from certain addresses, to disallow connections from
certain addresses, or to only accept connections from a specific network interface, by adding
only_from, no_access or bind options to the configuration files (have a look at the xinetd.conf man page
Code:
man xinetd.conf
for details on these and other configuration options).
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值