设置 Linux 主机的认证
您可以为 Linux 主机设置单向 CHAP 认证。
开始之前
系统支持单向 CHAP 认证,其中系统会认证主机 iSER 发起程序。
过程
要设置 Linux 主机的认证,请执行以下步骤:
- 使用适当的编辑器打开 /etc/iscsi/iscsid.conf 或 /etc/iscsid.conf。
-
转至 CHAP 设置段。
以下示例显示了输出:
图 1. Linux 主机的 CHAP 设置 #************* #CHAP Settings #************* #To enable CHAP authentication set node.session.auth.authmethod #to CHAP. The default is None. #node.session.auth.authmethod = CHAP #To set a CHAP username and password for initiator #authentication by the target(s), uncomment the following lines: #node.session.auth.username = username #node.session.auth.password = password node.session.auth.username = rhel_username node.session.auth.password = xxxxxxxxxxxxx #To set a CHAP username and password for target(s) #authentication by the initiator, uncomment the following lines: #node.session.auth.username_in = username_in #node.session.auth.password_in = password_in node.session.auth.password_in = yyyyyyyyyyyyy #To enable CHAP authentication for a discovery session to the target #set discovery.sendtargets.auth.authmethod to CHAP. The default is None. #discovery.sendtargets.auth.authmethod = CHAP discovery.sendtargets.auth.authmethod = CHAP #To set a discovery session CHAP username and password for the initiator #authentication by the target(s), uncomment the following lines: #discovery.sendtargets.auth.username = username #discovery.sendtargets.auth.password = password #To set a discovery session CHAP username and password for target(s) #authentication by the initiator, uncomment the following lines: #discovery.sendtargets.auth.username_in = username_in #discovery.sendtargets.auth.password_in = password_in -
设置单向认证。
- 设置发起程序名称的 CHAP 用户名和密码。
- node.session.auth.authmethod = CHAP
- node.session.auth.username = <initiator's user name>
- node.session.auth.password = <CHAP secret for host>
- 设置发起程序名称的发现会话 CHAP 用户名和密码。
- discovery.sendtargets.auth.authmethod = CHAP
- discovery.sendtargets.auth.username = <initiator's user name>
- discovery.sendtargets.auth.password = <CHAP secret for host>
- 保存这些设置。 您必须注销任何当前会话并重新发现系统 iSER 目标以使 CHAP 密码生效。
- 设置发起程序名称的 CHAP 用户名和密码。