[root@lab102 ~]# iscsiadm -m node -T iqn.2008-09.com.example:server.target1 -l Logging in to [iface: default, target: iqn.2008-09.com.example:server.target1, portal: 192.168.0.101,3260] (multiple) iscsiadm: Could not login to [iface: default, target: iqn.2008-09.com.example:server.target1, portal: 192.168.0.101,3260]. iscsiadm: initiator reported error (24 - iSCSI login failed due to authorization failure) iscsiadm: Could not log into all portals
但是会提示不允许连接 认证错误
1 2 3 4 5 6
[root@lab102 ~]# vim /etc/iscsi/iscsid.conf
# To set a CHAP username and password for initiator # authentication by the target(s), uncomment the following lines: node.session.auth.username = zp node.session.auth.password = 123456
/etc/iscsi/iscsid.conf # To set a CHAP username and password for initiator # authentication by the target(s), uncomment the following lines: node.session.auth.username = zp node.session.auth.password = 123456
# 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
int iscsi_setup_authentication(struct iscsi_session *session, struct iscsi_auth_config *auth_cfg) { /* if we have any incoming credentials, we insist on authenticating * the target or not logging in at all */ if (auth_cfg->username_in[0] || auth_cfg->password_in_length) { /* sanity check the config */ if (auth_cfg->password_length == 0) { log_warning("CHAP configuration has incoming " "authentication credentials but has no " "outgoing credentials configured."); return EINVAL; } session->bidirectional_auth = 1; } else { /* no or 1-way authentication */ session->bidirectional_auth = 0; }