美文网首页
CentOS安全

CentOS安全

作者: TroyZhang | 来源:发表于2017-02-08 00:05 被阅读204次

    查看登录日志

    $ last -f /var/log/wtmp
    

    查看�安全日志

    $ cat /var/log/secure
    

    Bad protocol version identification 'GET / HTTP/1.0' from 107.182.184.18 port 59428
    Did not receive identification string from 107.182.184.18
    Bad protocol version identification 'GET / HTTP/1.0' from 107.182.184.18 port 38416
    Did not receive identification string from 107.182.184.18
    Bad protocol version identification 'GET / HTTP/1.0' from 107.182.184.18 port 50051
    Did not receive identification string from 107.182.184.18
    Bad protocol version identification 'GET / HTTP/1.0' from 107.182.184.18 port 36287
    Did not receive identification string from 107.182.184.18
    Bad protocol version identification 'GET / HTTP/1.0' from 107.182.184.18 port 55816

    可以看到107.182.184.18这个ip一直在攻击服务器

    封ip

    执行之前看一个是不是自己的ip,千万不要把自己的ip给封了_

    // 封ip
    $ iptables -I INPUT -s 107.182.184.18 -j DROP
    
    // 解封
    $ iptables -D INPUT -s 107.182.184.18 -j DROP
    
    // 查看规则
    $ iptables -L -n
    

    禁用ping

    // 禁用ping
    $ echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all
    
    // 允许ping
    $ echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_all
    

    参考

    Centos 禁止IP、封IP、解除封IP的方法CentOS安全防御

    相关文章

      网友评论

          本文标题:CentOS安全

          本文链接:https://www.haomeiwen.com/subject/wvxlyttx.html