linux ip白名单
配置文件:/etc/hosts.allow
内容如下:
#
# hosts.allow This file contains access rules which are used to
# allow or deny connections to network services that
# either use the tcp_wrappers library or that have been
# started through a tcp_wrappers-enabled xinetd.
#
# See 'man 5 hosts_options' and 'man 5 hosts_access'
# for information on rule syntax.
# See 'man tcpd' for information on tcp_wrappers
#
sshd:210.192.100.
注意:ip后面不能缺少句点
为什么要配置/etc/hosts.allow
因为刚才我在公司登陆阿里云时老是登陆不了,我估计被自己给禁了,所以使用手机热点登陆
看到了登陆拒绝的信息:
编辑/var/log/secure
把被拒绝的ip加到白名单(/etc/hosts.allow )就ok了