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

相关推荐
嵌入式学习和实践35 分钟前
虚拟机 Ubuntu 磁盘扩容完全指南:从原理到实践,一步到位
linux·ubuntu·磁盘扩容
陳10301 小时前
Linux:进程间切换与调度
linux·运维·服务器
lcreek1 小时前
Linux 虚拟文件系统的建立与使用全过程解析
linux·虚拟文件系统·vfs
寒秋花开曾相惜2 小时前
(学习笔记)第四章 处理器体系结构
linux·网络·数据结构·笔记·学习
qcx232 小时前
【AI Agent实战】OpenClaw 安全加固完全指南:安全攻击手段与五步防护实践(2026最新)
人工智能·安全
疏星浅月2 小时前
虚拟内存三大核心作用详解
linux·c语言·arm开发·嵌入式硬件
邂逅星河浪漫3 小时前
【银行内网开发-管理端】Vue管理端+Auth后台开发+Nginx配置+Linux部署(详细解析)
linux·javascript·css·vue.js·nginx·html·前后端联调
JJay.3 小时前
Android BLE 稳定连接的关键,不是扫描,而是 GATT 操作队列
android·服务器·前端
SilentSamsara3 小时前
TCP 三次握手:连接建立失败的那些坑
运维·服务器·网络·网络协议·tcp/ip
码农小钻风4 小时前
利用Samba实现局域网跨平台共享文件
linux·samba·共享