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

相关推荐
毒爪的小新17 小时前
Linux 环境极速部署 vLLM:从零搭建生产级大模型推理服务
linux·人工智能·ai·语言模型·vllm
鹤落晴春17 小时前
RH124问答3:从命令行管理文件
linux·运维·服务器
凡人叶枫17 小时前
Effective C++ 条款30:透彻了解 inlining 的里里外外
linux·开发语言·c++·嵌入式开发·effective c++
火山上的企鹅18 小时前
Codex实战:APP远程升级服务搭建(三)后台管理页面(APK 上传、版本管理、多应用页签)
服务器·网络·数据库·oracle·qgc
Net_Walke18 小时前
【Linux系统】静态链接库与动态链接库
linux·嵌入式硬件
syc789012318 小时前
中文语境下AI编码工具实战对比:从迭代体验看日常开发选择
linux·人工智能·ubuntu
❀搜不到18 小时前
远程服务器codex使用本地cc-switch的deepseek api
运维·服务器
凡人叶枫18 小时前
Effective C++ 条款22:将成员变量声明为 private
linux·开发语言·c++
袁小皮皮不皮18 小时前
3.HCIP OSPF补充知识(优化版)
服务器·网络·数据库·网络协议·智能路由器
袁小皮皮不皮20 小时前
1.HCIP BFD 学习笔记(优化版)
服务器·网络·笔记·网络协议·学习·智能路由器·ip