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 \~#

相关推荐
Ivanqhz3 小时前
KV Cache
服务器·数据库·人工智能·深度学习·算法
H.莓飛3 小时前
【数据结构】二叉树
linux·数据结构·算法
欣欣之王来了3 小时前
5G网络基础:5G的核心特性,eMBB、uRLLC、mMTC的应用场景
网络·学习·计算机网络·安全·教程
天衍四九-3 小时前
Docker 进阶实战系列(一):容器镜像安全,最小镜像与非 Root 运行
安全·docker·eureka
荣合技术服务3 小时前
VMware ESXi 虚拟化平台服务器虚拟机数据恢复服务
linux·运维·服务器
杭州领祺科技3 小时前
保信子站深度解析:继电保护信息采集与故障诊断的关键枢纽
linux·服务器·网络·新能源·储能·虚拟电厂
Xudde.3 小时前
CVE-2026-24061漏洞复现
学习·安全
xh didida3 小时前
Linux -- 进程概念
linux·服务器·开发语言·c++
爱吃香菜的初学者3 小时前
十三.Linux——信号量
linux·运维·服务器·开发语言
小小龙学IT3 小时前
ROS2 安装完全指南(Ubuntu 版):从零开始到跑通第一个节点本文
linux·运维·ubuntu