我正在尝试将相同的sshd
设置应用于多个用户。
根据手册,它看起来Match User
像AND
:
引入条件块。如果
Match
满足该行上的所有条件,则以下各行上的关键字将覆盖在配置文件的全局部分中设置的那些关键字
我如何声明“对于这些用户中的任何一个...”,因此在此示例bob
中joe
,,和phil
被允许使用SSH作为代理,但不允许登录:
Match User bob, User joe, User phil
PasswordAuthentication yes
AllowTCPForwarding yes
ForceCommand /bin/echo 'We talked about this guys. No SSH for you!'
我自己还没有做这件事,我只能按照手册说的去做:
从sshd_config
手册中:
匹配模式可以由单个条目或逗号分隔的列表组成,并且可以使用的模式部分中描述的通配符和否定运算符
ssh_config(5)
。
这意味着您应该能够说
Match User bob,joe,phil
PasswordAuthentication yes
AllowTCPForwarding yes
ForceCommand /bin/echo 'We talked about this guys. No SSH for you!'
另请参阅信息安全论坛上的以下答案:https : //security.stackexchange.com/a/18038
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句