使用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
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
相关文章推荐
- lua实现多继承
- ___71__OleDbDataReader读取Access数据库
- Java 读取多个文件流合并操作
- BZOJ 1666: [Usaco2006 Oct]Another Cow Number Game 奶牛的数字游戏
- 《构建高可用Linux服务器》读书笔记
- 编译安装Apache(httpd-2.4.18)
- (四)activiti的几个核心类
- UNIX System Overview
- iOS网络编程
- How Many Tables(POJ 1213 求连通分量)
- 01参考资料
- maven创建web项目
- java Map集合框架之LinkedHashMap
- zookeeper的实用场景—
- android studio目录说明
- 自定义ListView实现下拉刷新
- USACO 1.1 ride
- WonderTeam
- 《时间序列分析及应用:R语言》读书笔记--第一章 引论
- (三)activiti框架搭建