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

相关推荐
yunlong326727 分钟前
吊车选型与载荷计算:避开4个坑,安全吊装不再难
安全·方案·事故·吊装·起重·吊装重量·吊装半径
IT大白鼠40 分钟前
MSF二次开发与自定义模块编写
网络·安全·web安全·msf
Flynt1 小时前
1200个AI Agent自己组了个群,把Hugging Face黑了
安全·openai·agent
Julien20041 小时前
调查和解决 SELinux 问题
linux·运维·服务器·网络·学习方法
2601_962074683 小时前
自己编译RustDesk,并将自建ID服务器和key信息写入客户端
运维·服务器
小张同学a.3 小时前
Docker 容器实战 1—— docker 基础与镜像构建
linux·运维·docker·容器
大模型丫丫4 小时前
Hermes Agent:轻量级智能体框架实战指南
大数据·运维·服务器
mooooooooooye5 小时前
2026 年跨平台 SSH 客户端怎么选?Xterminal、Termius、MobaXterm 谁更合适
服务器·网络·ssh
Blockchina5 小时前
Codex 实战:从一句需求到可验收的 Linux 主机巡检脚本
运维·服务器·网络
Best-Wishes6 小时前
BurpSuite Pro教育版在linux系统中配置
linux·运维·服务器·网络安全·burpsuite