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

相关推荐
2601_949847754 分钟前
bcrypt.js 跨端三方库仓颉适配全流程
linux·运维·ubuntu
m0_639906945 分钟前
Linux 操作系统入门:目录结构、服务排查常用命令、Shell 脚本基础
linux·运维·后端
今天重构了吗1 小时前
Linux 上 rm -rf 删错了能找回吗
运维·服务器
EnCi Zheng1 小时前
后端怎么把AI接口稳定安全低成本接进业务:超时重试、密钥隔离与成本熔断清单
人工智能·后端·安全·架构·api
Smoothcloud润云2 小时前
GPU远程纳管安全吗?最小权限、网络边界与日志审计实战
服务器·网络·人工智能·安全·gpu算力·gpu
ai大模型-探索者2 小时前
Function Call与MCP(区别、联系与实战)
java·服务器·网络
略略略咯咯2 小时前
啊啊啊啊啊
java·服务器·数据库
水饺编程2 小时前
第2章:Linux 基础,exit 命令
linux·c语言·汇编
木子欢儿2 小时前
Debian 13 + vsftpd 搭建FTP服务
linux·服务器·前端·网络·debian
达~熊迪3 小时前
IP 分配前核查:把在线状态和使用登记一起看
服务器·网络·tcp/ip