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

相关推荐
TangGeeA1 小时前
命令安全设置
java·服务器·安全
水饺编程1 小时前
第2章:Linux 基础,rm 命令
linux·c语言·汇编
范同学~1 小时前
固定表头+第一列+最后一列
java·服务器·前端
雪落漂泊1 小时前
Linux基础开发工具(三)gcc/g++与make/makefile篇
linux·运维·服务器
爱吃辣椒的小豆豆1 小时前
Linux-sshd-实战-白名单与跳板机
linux·运维·服务器
气质、小青年!1 小时前
进程1学习
linux·学习
mmsx2 小时前
Android APK 加固方案怎么落地:从加壳到校验的组合取舍
android·网络·安全·签名
强哥聊算力2 小时前
《算力江湖·国产GPU突围:摩尔线程故事》第四集:从图形到AI:摩尔线程为什么必须冲进大模型赛道?
运维·服务器·人工智能·ai·gpu算力
blueSatchel2 小时前
framebuffer注册源码解读
linux·嵌入式
User_芊芊君子2 小时前
官方 URDF 之外:把启元 Q1 放进 MuJoCo 物理仿真跑起来
安全·ai·大模型