Instance server = DB2/LINUX 9.7.5 Authorization ID = DB2INST1 Local instance alias = DB2INST1 在这里,隐式地执行身份验证。使用登录机器的用户ID,并假设这个ID已经经过了操作系统的检验。 $ db2 connect to sample user db2inst1 using a Database Connection Information
Database server = DB2/LINUX 9.7.5 SQL authorization ID = DB2INST1 Local database alias = SAMPLE 在这里,显式地执行身份验证。用户db2inst1和密码a由操作系统进行检验。用户db2inst1成功地连接到示例数据库。 db2 connect to sample user test1 using password new chgpass confirm chgpass
DRDAONLY 意味着只信任主机客户机,而不管使用 DRDA 进行连接的 DB2 Version 8 客户机。 下面的示例说明如何在服务器和客户机上设置身份验证类型和参数: 在服务器上设置身份验证:
$db2 update dbm cfg using authentication client $db2 update dbm cfg using trust_allclnts yes $db2 update dbm cfg using trust_clntauth server $db2stop $db2start 在客户机上设置身份验证:
$db2 catalog database sample at node nd1 authentication client 在上面的示例中,如果从任何客户机发出命令 db2 connect to sample 那么身份验证在客户机上进行。如果从任何客户机发出命令 db2 connect to sample user test1 using password 那么身份验证在服务器上进行。
Client Userid-Password Plugin (CLNT_PW_PLUGIN) = Group Plugin (GROUP_PLUGIN) = GSS Plugin for Local Authorization (LOCAL_GSSPLUGIN) = Server Plugin Mode (SRV_PLUGIN_MODE) = UNFENCED Server List of GSS Plugins (SRVCON_GSSPLUGIN_LIST) = Server Userid-Password Plugin (SRVCON_PW_PLUGIN) = Cataloging allowed without authority (CATALOG_NOAUTH) = NO Bypass federated authentication (FED_NOAUTH) = NO 在上面的列表中,去掉了已经讨论过的参数。