hosts.allow和hosts.deny配置

有个单机环境限制ssh登录,有多种方式,这里选择了配置hosts.allow和hosts.deny

[root@db ~]# more /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:172.100.100.56:allow

sshd:172.100.100.57:allow

sshd:172.100.100.42:allow

sshd:172.100.100.43:allow

sshd:172.100.100.46:allow

[root@db ~]# cat /etc/hosts.deny

hosts.deny This file contains access rules which are used to

deny connections to network services that either use

the tcp_wrappers library or that have been

started through a tcp_wrappers-enabled xinetd.

The rules in this file can also be set up in

/etc/hosts.allow with a 'deny' option instead.

See 'man 5 hosts_options' and 'man 5 hosts_access'

for information on rule syntax.

See 'man tcpd' for information on tcp_wrappers

sshd:all:deny

[root@db ~]#

相关推荐
Hacker_Fuchen30 分钟前
ctf网络安全题库 ctf网络安全大赛答案
安全·web安全
心随_风动33 分钟前
CentOS 下安装和配置 HTTPD 服务的详细指南
linux·运维·centos
信阳农夫37 分钟前
centos 7只能安装到3.6.8
linux·运维·centos
木谷羊宫切割1 小时前
玩机日记 12 群晖部署AList并配置SSL,安装opkg,使用rclone挂载到本地
服务器·网络协议·ssl
2401_867021902 小时前
linux下软件安装、查找、卸载
linux
TT-Kun2 小时前
Linux | 进程控制(进程终止与进程等待)
linux·运维·服务器
...:...:...2 小时前
Linux 第三次脚本作业
linux·运维·服务器
二十七剑3 小时前
jvm调试和查看工具
java·linux·jvm
菜菜小蒙3 小时前
【Linux】基于UDP/TCP服务器与客户端的实现
linux·服务器·udp
a小胡哦3 小时前
Windows、Mac、Linux,到底该怎么选?
linux·windows·macos·操作系统