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

相关推荐
熊猫钓鱼>_>21 分钟前
平行视界兼容模式与魔法变量配置避坑【鸿蒙心迹】
运维·服务器·开发语言·笔记·华为·harmonyos·openharmony
衡石科技35 分钟前
让多轮问数保持口径一致:Data Agent 的上下文、偏好与学习开关
人工智能·学习·安全
皓月盈江35 分钟前
GO使用Gin框架实现模板定义、解析与渲染
linux·golang·go·gin·定义模板·解析模板·渲染模板
T量子永生43 分钟前
Unisoc(紫光展锐) Kernel 6.18 DDK 编译框架详解
linux·运维·spring
niuyueyang1 小时前
MCP `/mcp/status` Lifecycle 技术方案
java·服务器·数据库
曦夜日长1 小时前
主从 Reactor 高并发服务器实战 (三):服务器套接字Socket模块详解与实现
运维·服务器·网络
z06.2 小时前
Linux系统中MySQL的安装
linux·mysql
用户790860057262 小时前
扫出 176 个「危险代码」,结果一个都不用删:我的静态安检门禁
安全
wzg20162 小时前
ubuntu通过docker镜像部署安装onlyoffice
linux·ubuntu·docker
武天旭2 小时前
AI安全--AI大模型的关键技术组成
人工智能·深度学习·安全·机器学习