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

相关推荐
AOwhisky29 分钟前
Ceph系列第三期:Ceph 集群核心配置与管理
linux·运维·数据库·笔记·ceph
天疆说33 分钟前
在 Ubuntu 上安装 NASA GMAT R2026a 轨道设计软件
linux·运维·ubuntu
铅笔小新z43 分钟前
【Linux】线程同步与互斥
linux·服务器
代码小书生1 小时前
getpass,一个安全输入的 Python 库!
开发语言·python·安全
ylscode1 小时前
Pentest Swarm AI:开源群体智能架构如何重构自主渗透测试的边界
网络·安全·安全威胁分析
AI行业学习1 小时前
CC-Switch 下载、安装windows\macOS \Linux 安装
linux·运维·macos
KaMeidebaby1 小时前
卡梅德生物技术快报|基因测序技术在 46,XY 性发育障碍变异筛查中的流程与数据分析
服务器·前端·数据库·人工智能·算法·数据挖掘·数据分析
mosaic_born2 小时前
systemctl restart reload enable 重启服务时的区别
linux
m0_738120722 小时前
渗透测试基础——黑盒测试下的Web漏洞挖掘与利用解析(二)
服务器·前端·python·网络协议·安全·网络安全
文青小兵2 小时前
Linux云计算——docker compose haibor elfk (四)
linux·服务器·docker·云计算