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

相关推荐
箓维3 分钟前
线程的优缺点,与进程的关联和差异
java·服务器·笔记
不会就选b13 分钟前
Linux之http会话
服务器·网络协议·http
其实防守也摸鱼13 分钟前
SQL注入实验笔记
android·运维·数据库·安全·oracle·自动化
江屿风14 分钟前
【Linux系统】【从【收尾】缓冲区到【新开】磁盘块:一节课打通文件系统底层原理】流食般投喂
linux·运维·服务器·人工智能·笔记
Pointer Pursuit17 分钟前
编辑器Vim
linux·编辑器·vim
_upupup24 分钟前
Linux中的权限解析
linux·服务器
曹牧25 分钟前
Spring MVC : Controller 层URL划分
java·运维·服务器·前端
路漫漫其修远兮sjw25 分钟前
Linux 运维知识点笔记(中级)
linux·运维·笔记
石一峰69929 分钟前
Linux INPUT 与 I2C 子系统关联
linux·运维·计算机外设
jimmyleeee44 分钟前
大模型安全之三十五:间接Prompt 注入测试全景指南
安全·prompt