免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 691 | 回复: 0
打印 上一主题 下一主题

linux 下的访问控制 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-01-20 20:37 |只看该作者 |倒序浏览

@--------------------------------------------------------------------------------------
@ - 限制IP
@ - linux
@ - 2005-08-11
@ - ATG
@--------------------------------------------------------------------------------------

1.1 在LINUX下我们可以有很多方法可以控制用户的登路
    1.1.1 我先讲讲怎么控制ftp服务吧
        在/etc/ftpusers 这个文件可以控制用户的的FTP只要把用户名写入文件就可以了!
        ------------------------------------------------------------------------
      -  |# ftpusers      This file describes the names of the users that may
        |#_*NOT*_ log into the system via the FTP server.
        |#This usually includes "root", "uucp", "news" and the
        |#like, because those users have too much power to be
        |#allowed to do "just" FTP...
        |#
        |adabas
        |amanda
        |at
        |bin
        |cyrus
        |daemon
        |dbmaker
        |db2fenc1
        ---------------------------------------------------------------------------
    1.1.2 来一个更NB的就是把LINUX的全部方式都不能登路   
        在/ect/hosts.allow 与 /ect/hosts.deny这两个文件
        我们先看一下hosts.deny这是用来关闭服务的
        ---------------------------------------------------------------------------
        # /etc/hosts.deny
        # See `man tcpd?and `man 5 hosts_access?as well as /etc/hosts.allow
        # for a detailed description.
        
        http-rman : ALL EXCEPT LOCAL
        // 以下我们自己加上去的
        #ALL:

[email=ALL@ALL]ALL@ALL[/email]
, PARANOID    // 表示把全部关闭
        in.telnetd :

[email=ALL@ALL]ALL@ALL[/email]
, PARANOID
        pure-ftpd :

[email=ALL@ALL]ALL@ALL[/email]
, PARANOID
        ---------------------------------------------------------------------------
            
        然后再看看hosts.allow这是用来控制服务的
        -------------------------------------------------------------------------------------------
        # Example 3: run a different instance of rsyncd if the connection comes
        #            from network 172.20.0.0/24, but regular for others:
        # rsyncd : 172.20.0.0/255.255.255.0 : twist /usr/local/sbin/my_rsyncd-script
        # rsyncd : ALL : ALLOW
        #
        // 以下我们自己加上去的
        //             表示只有这个网段才能上      但这两个不能上
        //                    |                           |
        in.telnetd : 192.118.103. EXCEPT 192.118.103.250 192.118.103.253
        in.telnetd : ALL : \
           twist /bin/echo -e "\n\raccess from %h declined(拒绝连接).\n\r未经认证Go away.";sleep 2
        
        in.telnetd : 192.118.128.
        in.telnetd : ALL : \
           twist /bin/echo -e "\n\raccess from %h declined(拒绝连接).\n\r未经认证Go away.";sleep 2
        
        in.telnetd : 192.119.172.
        in.telnetd : ALL : \
           twist /bin/echo -e "\n\raccess from %h declined(拒绝连接).\n\r未经认证Go away.";sleep 2
        
        pure-ftpd : 192.118.103. EXCEPT 192.118.103.250
        pure-ftpd : ALL : \
           twist /bin/echo -e "\n\raccess from %h declined.\n\r未经认证Go away.";sleep 2
        
        #pure-ftpd : 192.118.128.
        #pure-ftpd : ALL : \
        #   twist /bin/echo -e "\n\raccess from %h declined.\n\r未经认证Go away.";sleep 2
        
        pure-ftpd : 192.119.172.
        pure-ftpd : ALL : \
           twist /bin/echo -e "\n\raccess from %h declined.\n\r未经认证Go away.";sleep 2
        ---------------------------------------------------------------------------------------------
        OK到这就搞定了!



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/8649/showart_69468.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP