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

相关推荐
ltl33 分钟前
内核追踪:ftrace、kprobe、uprobe、tracepoint 生产实战
linux
·薯条大王36 分钟前
经济实惠玩云服务器|一台云服务器多人共用,子账号配置教程
java·linux·运维·服务器·汇编·c++·python
互联网中的一颗神经元1 小时前
04 — 安全撤销:改错了怎么退回去
大数据·安全·elasticsearch
ZJH__GO4 小时前
网络编程v4pro--实现聊天室文件传输功能
java·服务器·网络·计算机网络
小小、码农4 小时前
Linux进程控制:从fork到exec,手写一个简易Shell
linux·运维·服务器
不会就选b4 小时前
Linux之进程间通信(二)---模拟进程池
linux·运维·服务器
NeilYuen5 小时前
用UDP实现向DNS服务器请求IP地址
服务器·tcp/ip·udp
智脑API5 小时前
Claude Code sandbox.failIfUnavailable 怎么用?沙箱启动失败、拒绝降级和 CI 安全
安全·ci/cd
笨#小孩6 小时前
文件上传漏洞:原理与20种实战绕过方法(上)
安全·web安全
沫璃染墨6 小时前
《从零入门Linux系统篇(十五):系统工具篇·六——GDB调试器详解:从程序执行控制到高级调试技巧》
linux·运维·服务器·c语言·c++