zoukankan      html  css  js  c++  java
  • linux禁ping与限制ip登录

    以root进入linux系统,然后编辑文件icmp_echo_ignore_all
    vi /proc/sys/net/ipv4/icmp_echo_ignore_all
    将其值改为1后为禁止PING
    将其值改为0后为解除禁止PING

    我的LNUX也不是很好希望大家以后多多指点!

    echo > 1 /proc/sys/net/ipv4/icmp_echo_ignore_all禁ping
    echo > 0 /proc/sys/net/ipv4/icmp_echo_ignore_all解ping

    ============================================================================================
    在/etc/hosts.allow输入   
      (其中192.168.10.88是你要允许登陆ssh的ip,或者是一个网段192.168.10.0/24)   
      sshd:192.168.10.88:allow   
        
      在/etc/hosts.deny输入(表示除了上面允许的,其他的ip   都拒绝登陆ssh)   
      sshd:ALL
    比如说你只允许1.1.1.1这个IP进入,其它都禁止:   
      方法1、iptables。   
      iptables   -A   INPUT   -p   tcp   -s   1.1.1.1   --destination-port   22   -j   ACCEPT   
      iptables   -A   INPUT   -p   tcp   --destination-port   22   -j   DROP     
      方法2:   
      vi   /etc/ssh/sshd_config   
      添加一行:   
      allowusers   xxx@1.1.1.1   
      注:xxx为你用来登入服务器的用户名

    转:http://aaaxiang000.blog.163.com/blog/static/206349122010112710545659/

  • 相关阅读:
    JavaScript中的数组
    JavaScript中的对象
    Highcharts中设置x轴为时间的写法
    CSS 选择器(基础)
    DOM节点
    平衡木蜻蜓
    python2.7 qt4
    C语言优先级
    树莓派与stm32通信
    linux下USB转串口配置
  • 原文地址:https://www.cnblogs.com/yiwd/p/3253578.html
Copyright © 2011-2022 走看看