我Match
在 OpenSSH 中/etc/ssh/sshd_config
(在 debian 上)使用一个块来限制一些用户使用 SFTP:
# my stuff
Match group sftponly
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp -u 0002
ChrootDirectory %h
Run Code Online (Sandbox Code Playgroud)
如您所见,我#my stuff
在自定义配置文件中使用注释来轻松区分默认配置和我所做的配置(并将它们放在配置文件的末尾)。
现在我想将指令附加UseDNS no
到配置中(以加快登录速度),但 OpenSSH 说Directive 'UseDNS' is not allowed within a Match block
.
现在我想知道是否有类似于End Match
结束这些匹配块的语法?
lox*_*axs 48
要使用 openssh 6.5p1 或更高版本结束匹配块,请使用以下行: Match all
这是一段代码,取自我的/etc/ssh/sshd_config
文件:
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication no
Match host 192.168.1.12
PasswordAuthentication yes
Match all
X11Forwarding yes
X11DisplayOffset 10
Run Code Online (Sandbox Code Playgroud)
一条有鞋底的线是Match
行不通的。(它对我不起作用,sshd 拒绝启动)
mre*_*hub 47
似乎没有办法明确结束 Match 块。从sshd_config 手册页:
如果满足 Match 行上的所有条件,则以下行中的关键字将覆盖在配置文件的 global 部分中设置的那些,直到另一个 Match 行或文件末尾。
所以Match
块需要在sshd_config
文件的末尾。
归档时间: |
|
查看次数: |
54542 次 |
最近记录: |