此过程在 /etc/ssh/sshd_config 文件的全局部分之后添加了一个有条件的 Match 块。Match 块后的关键字-值对为指定为匹配的用户、组、主机或地址指定例外。
开始之前
您必须是指定有 solaris.admin.edit/etc/ssh/sshd_config 授权的管理员。缺省情况下,root 角色拥有此授权。有关更多信息,请参见在 Oracle Solaris 11.2 中确保用户和进程的安全 中的使用所指定的管理权限。
# pfedit /etc/ssh/sshd_config
将 Match 块置于全局设置之后。
例如,您可能有不允许使用 TCP 转发的用户。在以下示例中,public 组中的所有用户和以 test 开头的所有用户名都不能使用 TCP 转发:
## sshd_config file ## Global settings # Example (reflects default settings): # # Host * # ForwardAgent no # ForwardX11 no # PubkeyAuthentication yes # PasswordAuthentication yes # FallBackToRsh no # UseRsh no # BatchMode no # CheckHostIP yes # StrictHostKeyChecking ask # EscapeChar ~ Match Group public AllowTcpForwarding no Match User test* AllowTcpForwarding no
有关 Match 块的语法的信息,请参见 sshd_config(4) 手册页。