設定 Linux 主機的鑑別
您可以為 Linux 主機設定單向 CHAP 鑑別。在配置用於主機的單向鑑別之後,可以選擇性設定雙向鑑別。
開始之前
系統支援兩種盤查信號交換驗證通訊協定 (CHAP) 方法:
- 單向 CHAP 鑑別(系統鑑別主機 iSCSI 起始器)。
- 雙向 CHAP 鑑別(系統和起始器彼此鑑別)。
註: 您為單向鑑別和雙向鑑別選取的 CHAP 密碼必須不同。
程序
如果要設定 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>
- 儲存這些設定。您必須登出任何現行階段作業,並重新探索系統 iSCSI 目標,以便讓 CHAP 密碼生效。
註: 在上述範例中,xxxxxxxxxxxxx 是主機的 CHAP 密碼,rhel_username 是起始器的 IQN 名稱。該使用者名稱必須是使用 chhost 指令(iscsiusername 欄位)為該主機設定的相同值。 - 設定 CHAP 使用者名稱與密碼給您的起始器名稱。
- 設定雙向鑑別。註: 設定雙向鑑別並非必要。在您配置使用雙向鑑別之前,請確定單向鑑別已配置且適用於您的主機。
- 將 password_in 編輯成您在系統上使用 chsystem 指令所設定的 CHAP 密碼。
- 為一或多個目標,設定 CHAP 使用者名稱與密碼。
- node.session.auth.password_in = <CHAP secret for clustered system>
- 為一或多個目標,設定探索階段作業 CHAP 使用者名稱與密碼。
- discovery.sendtargets.auth.password_in = <CHAP secret for clustered system>
- 為一或多個目標,設定 CHAP 使用者名稱與密碼。
- 儲存這些設定。您必須登出任何現行階段作業,並重新探索系統 iSCSI 目標,以便讓 CHAP 密碼生效。
- 將 password_in 編輯成您在系統上使用 chsystem 指令所設定的 CHAP 密碼。
- 設定單向鑑別:
上層主題: 安裝 Linux 軟體 iSCSI 起始器