在用户的 .rhosts 文件中,用户可以列出可从中作为可信用户进行连接的主机。.rhosts 文件位于数据库服务器所在的计算机上的用户主目录中。 要启用可信用户认证,请在 sqlhosts 条目的选项中指定 s=2 或 s=3。如果未指定 s 选项,s=3 是缺省值。
无法使用用户的 .rhosts 文件的原因可能有多种。例如,非 root 安装可能对特定用户的 .rhosts 文件不具有读访问权。 通过设置 REMOTE_USERS_CFG 配置参数,可以指定备用文件名。如果设置此参数,数据库服务器只有一个可信用户文件用于所有用户。
#trustedusers xxx.example.com xxx yyy.example.com yyy
hostname username例如,假设针对用户 John 和 Fred 存在以下两个 .rhosts 文件:
#trustedhosts xxx.example.com xxx yyy.example.com yyy~fred/.rhosts
#trustedhosts xxx.example.com xxx zzz.example.com zzzJohn 不信任 zzz.example.com 或 zzz,而 Fred 不信任 yyy.example.com 或 yyy。
#trustedhost username xxx.example.com john xxx john yyy.example.com john yyy john xxx.example.com fred xxx fred zzz.example.com fred zzz fred