0

I am trying to configure the iscsid.conf in my host to enable CHAP authentication for the discovery with my target but the changes are not being reflected. I have restarted the service after making the changes. Is there any other file to change also?

I know the target name so if i try to login directly it is working fine with CHAP mechanism.enter image description here

enter image description here

lokesharo
  • 305
  • 2
  • 11

2 Answers2

0

Getting iscsiadm to use CHAP for discovery is tricky. There's two parts:

First, iscsiadm creates a bunch of configuration in /var/lib/iscsi. In your case, after running with -m discovery, you should have the file:

/var/lib/iscsi/sendtargets/192.168.53.200,3260/st_config

Edit that file to change authmethod to CHAP and add your username and password:

discovery.sendtargets.auth.authmethod = CHAP discovery.sendtargets.auth.username = discovery.sendtargets.auth.password =

Then, use "-m discoverydb" instead of "-m discover" to make use of the stored configuration. Include "--discover" on your command line:

iscsiadm -m discoverydb -p 192.168.53.200 -t st --discover

Take care to use discoverydb -- if you do "-m discover" it'll just blow away your changes to that st_config file, and you'll have to edit it again.

Mike Andrews
  • 3,045
  • 18
  • 28
0

Your sendtargets is not working but login is working because sendtargets is picking CHAP detail from st_config. If there are many target configurations and you want to change CHAP setting of all of them here is what I do:

  1. stop iscsid service
  2. rm -rf /var/lib/iscsi/send_targets/*

    this will remove all old discovery configuration data

  3. start the service again

When you remove existing file and try discovery It will take iscsi.conf file.