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

相关推荐
Mr.HeBoYan13 分钟前
一次持续三天才出现的丢包故障——深入解析 DPDK Memory Ordering、rte_ring 与 CPU Memory Barrier (下)
linux·网络·算法·架构·dpdk
初願致夕霞2 小时前
C++懒汉单例设计详解
服务器·开发语言·c++
Discipline~Hai2 小时前
ARM01-ARM体系架构
linux·c语言·arm开发·架构
RisunJan3 小时前
Linux命令-screen(终端复用器)
linux·运维
啊哦1113 小时前
安装VMware Workstation
linux·运维·服务器
持敬chijing4 小时前
Linux基础命令与目录命令
linux·运维·服务器
yunwei374 小时前
实证研究:AI Agent 规则需要上下文与分层强制执行
linux·安全·ai编程
小张成长计划..4 小时前
【Linux】12:进程状态
linux·运维·服务器
会周易的程序员4 小时前
Libnodave S7 通信库:架构设计与实现解析
linux·c++·物联网·架构·c·s7·工业协议
kp000004 小时前
System Prompt Leakage(系统提示词泄露)及安全防御
网络·安全·网络安全·信息安全·prompt·ai安全