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

相关推荐
M78佐菲5 小时前
ARM学习笔记(1)
linux·arm开发·笔记·嵌入式硬件·学习
红姐跨境书5 小时前
从零打造高性能 API 网关: Go 语言中的双缓冲 Dynamic Config 最佳实践
安全
益达丫6 小时前
Socket编程揭秘:端口、IP与进程通信的底层逻辑
linux·笔记
比兔代理6 小时前
正向代理与反向代理技术辨析,为什么代理 IP 属于正向代理
服务器·网络·http·ip
Wang's Blog8 小时前
Java 接入Redis: 通用命令与键管理
java·服务器·redis
Wang's Blog8 小时前
Java 接入Redis: 列表集合与有序集合操作命令
java·服务器·redis
Ivanqhz8 小时前
SVD++算法
java·服务器·网络·深度学习·神经网络
chicheese9 小时前
Linux 面试速查表:从初级到高级,附高频场景答题模板
linux·运维
Linux-lucky9 小时前
32-38-Linux学习之旅之MySQL综合
linux·运维·学习·mysql·ubuntu
vortex510 小时前
常用终端模拟器全面对比:Kitty、WezTerm、Ghostty 与 Konsole
linux