在此过程中,您将在 Oracle Solaris 远程系统上启用基于主机的验证,然后再向其添加 Trusted Extensions 功能。远程系统是 安全 Shell 服务器。
开始之前
远程系统随 Oracle Solaris 一起安装,并且您可以访问该系统。您必须是 root 角色。
有关过程,请参见在 Oracle Solaris 11.2 中管理安全 Shell 访问 中的如何设置基于主机的安全 Shell 验证。
完成此步骤后,您将在这两个系统上具有可承担 root 角色的用户帐户。为这些帐户分配了相同的 UID、GID 以及角色。此外,您已经生成公钥/私钥对,并共享公钥。
# pfedit /etc/ssh/sshd_config ## Permit remote login by root PermitRootLogin yes
随后的步骤将限制 root 登录到特定的系统和用户。
# svcadm restart ssh
# cd # pfedit .shosts client-host username
当共享公钥/私钥时,.shosts 文件将使 client-host 系统上的 username 能够承担服务器上的 root 角色。
# cp /etc/pam.d/other /etc/pam.d/other.orig
# pfedit /etc/pam.d/other ... # Default definition for Account management # Used when service name is not explicitly mentioned for account management # ... #account requisite pam_roles.so.1 # Enable remote role assumption account requisite pam_roles.so.1 allow_remote ...
此策略使 client-host 系统上的 username 能够承担服务器上的角色。
# pfedit /etc/pam.d/other # Default definition for Account management # Used when service name is not explicitly mentioned for account management # ... #account requisite pam_roles.so.1 # Enable remote role assumption account requisite pam_roles.so.1 allow_remote # account required pam_unix_account.so.1 #account required pam_tsol_account.so.1 # Enable unlabeled access to TX system account required pam_tsol_account.so.1 allow_unlabeled
% ssh -l root remote-system
# svcadm enable -s labeld # /usr/sbin/reboot
在此示例中,管理员将使用 Trusted Extensions 系统来配置远程 Trusted Extensions 主机。为此,管理员将在每个系统上使用 tncfg 命令来定义对等系统的主机类型。
remote-system # tncfg -t cipso add host=192.168.1.12 Client-host
client-host # tncfg -t cipso add host=192.168.1.22 Remote system
要使管理员可以通过无标签系统配置远程 Trusted Extensions 主机,管理员需要在远程主机的 pam.d/other 文件中保留 allow_unlabeled 选项。