|
关于TCP_wrapper,hosts.allow中后台进程的问题,kevin能不能解答一下?
在教材中有如下的表述:
后台进程应该是服务的可执行工具名,例如:ftp服务的可执行工具是vsftpd,
因此在/etc/hosts.allow及/etc/hosts.deny中应该写vsftpd
可以使用的后台进程:
sendmail , slpad,sshd, stunnel,tcpd, xinetd,gdm,gnome-session,ORBit
portmap (注意nis及 nfs依赖 portmap)
我对此理解是:上述所列的后台进程是可以被写在hosts.allow,hosts.deny
中的,其它的是不可以的,如:httpd,smbd(虽然没有明确指出)
我在参考手册中看到一段话:
NOTE:
To determine if a network service binary is linked against libwrap.a,type the
following command as the root user:
string -f <binary-name> |grep hosts_access
Replace <binary-name> with the name of the network service binary.
If a prompt is returned ,the network service is not linked against libwrap.a
依据这段话的意思,只要用命令:
string -f <binary-name> |grep hosts_access
查看网络服务后台进程没有返回值,就可以将这个网络服务后台进程写入
/etc/hosts.allow和/etc/hosts.deny中.
我简单试了一下:/usr/sbin/下的一些程序:
httpd,imapd ,in.telnetd,ipop2d,ipop3d, named ,postfix,
sendmail, smbd,squid,ypserv 都没有返回值.
而httpd,named,smbd不能在hosts.allow,hosts.deny中实现基于主机的限制,
(虽然在httpd,smbd的配置文件就可实现基于主机的控制)
是不是教材中只是例举了部分做例子?
另外,如果nfs 写在hosts.allow,hosts.deny中,应该写portmap,
我在服务端用了:/etc/hosts.deny portmap:192.168.1.5
并没有阻止192.168.1.5访问服务器,写错了什么吗?
怎样写nfs中基于主机的控制? |
|