美文网首页
linux系统如何限制远程登录ip

linux系统如何限制远程登录ip

作者: 小小全_ | 来源:发表于2019-07-08 08:32 被阅读0次

    在Linux系统上限制远程登录的IP,使用系统自带的配置文件。

    /etc/hosts.allow

    /etc/hosts.deny

    匹配原则 先allow 后deny.

    要求: 只允许 192.168.0.1 和 192.168.0.10 登陆 其他全部禁止

    实现:

    1. vim /etc/hosts.allow //增加如下内容
      sshd: 192.168.0.1, 192.168.0.10

    2. vim /etc/hosts.deny //增加如下内容
      sshd: ALL

    要求: 只限制192.168.0.1登陆上来,其他全部放行

    实现:
    vim /etc/hosts.deny //增加如下内容
    sshd: 192.168.0.1

    [参考:]https://www.cnblogs.com/lin1/p/5581062.html

    相关文章

      网友评论

          本文标题:linux系统如何限制远程登录ip

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