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

相关推荐
Rockbean8 小时前
用40行代码搭建自己的无服务器OCR
服务器·python·deepseek
茶杯梦轩11 小时前
CompletableFuture 在 项目实战 中 创建异步任务 的核心优势及使用场景
服务器·后端·面试
崔小汤呀12 小时前
最全的docker安装笔记,包含CentOS和Ubuntu
linux·后端
何中应12 小时前
vi编辑器使用
linux·后端·操作系统
何中应12 小时前
Linux进程无法被kill
linux·后端·操作系统
何中应12 小时前
rm-rf /命令操作介绍
linux·后端·操作系统
何中应13 小时前
Linux常用命令
linux·操作系统
葛立国13 小时前
从 / 和 /dev 说起:Linux 文件系统与挂载点一文理清
linux
海天鹰1 天前
【免费】PHP主机=域名+解析+主机
服务器
一次旅行1 天前
网络安全总结
安全·web安全