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

相关推荐
张洛闻Eren21 分钟前
MySQL 维护稳定系统【MySQL第二课】
linux·数据库·mysql·云原生
ltl44 分钟前
Linux 异步 I/O:epoll 与 io_uring 对比
linux
ltl1 小时前
压缩算法工程实践:吞吐、比率与 CPU 权衡
linux
fiveym2 小时前
01 - iPXE + Clonezilla 网络装机原理解析
linux·运维·服务器·网络
虎头金猫2 小时前
如何在群晖NAS上通过Docker部署CloudSaver?群晖部署CloudSaver教程|聚合资源搜索并实现远程访问
运维·服务器·网络·python·docker·容器·pandas
dog2502 小时前
网络优化,还是降低各阶矩
服务器·网络·php
-今昭-4 小时前
Ansible
linux·运维·ansible
一次旅行5 小时前
2026.08.16 AI产业深度解读|国产大模型全面突围,算力硬件/智能安全/人形机器人四大趋势附落地方案
人工智能·安全·机器人
mounter6255 小时前
MACsec 全景解析:从技术演进、核心架构到 DPU 硬件卸载与 K8s 大规模调度实战
linux·kubernetes·linux kernel·kernel·macsec
IT邦德6 小时前
Dify1.6基于ubuntu系统的部署实战
linux·运维·ubuntu