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

相关推荐
好奇的菜鸟1 小时前
WSL上的Ubuntu 24.04 (Noble Numbat) 配置阿里云镜像源,提速软件安装
linux·ubuntu·阿里云
海棠蚀omo1 小时前
Linux信号保存的核心:未决信号集与阻塞信号集——探秘内核如何实现信号的阻塞、暂存与派发
linux·操作系统
人机与认知实验室1 小时前
香港火灾与人机环境系统安全
安全·系统安全
傲世(C/C++,Linux)2 小时前
Linux系统编程——TCP服务器
linux·服务器·tcp/ip
杨云龙UP3 小时前
SQL Server 备份异地同步 + 清理脚本
运维·服务器·数据库·sql·mysql·sqlserver
极地星光3 小时前
C++链式调用设计:打造优雅流式API
服务器·网络·c++
橘子真甜~4 小时前
C/C++ Linux网络编程8 - epoll + ET Reactor TCP服务器
linux·服务器·网络
万变不离其宗_84 小时前
centos 手动安装redis
linux·redis·centos
_lst_4 小时前
linux进程状态
linux·运维·服务器
麦聪聊数据4 小时前
IT 的“控”与业务的“放”:构建基于 Web 原生架构的安全数据共享平台
数据库·sql·安全