您的位置:首页 > 其它

使用xinetd进行在线设备的访问控制

2016-02-04 11:48 357 查看
1. 在/etc/xinetd.d下创建文件ccagent,内容如下:

service ccagent
{
disable = no
flags = REUSE
type = UNLISTED
port = 9991
protocol = tcp
socket_type = stream
wait = no
user = root
redirect = 127.0.0.1 1988
log_type = SYSLOG daemon debug
log_on_success += DURATION HOST USERID TRAFFIC
}

###单机监控server绑定127.0.0.1,监听端口1988
2. 修改/etc/hosts.allow文件,加入访问控制:

ccagent : 192.168.2.143: allow
ccagent : ALL : deny
3. 在192.168.2.208上访问,可以看到访问被拒绝 /var/log/syslog

Aug 15 15:49:32 ldap xinetd[34959]: libwrap refused connection to ccagent (libwrap=ccagent) from 192.168.2.208
4. /etc/xinetd.conf 的内容

defaults
{

# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
log_type = SYSLOG daemon debug

}

includedir /etc/xinetd.d
5. 重启xinetd

service xinetd restart
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: