Edit the following file:

Sudo Nano /etc/iscsi/iscsid.conf

Remove the # from the following lines and update the username and password accordingly

node.session.auth.authmethod = CHAP
node.session.auth.username = username
node.session.auth.password = inboundpassword
discovery.sendtargets.auth.authmethod = CHAP
discovery.sendtargets.auth.username = username
discovery.sendtargets.auth.password = inboundpassword

Now you can run a discovery scan

iscsiadm -m discovery -t st -p ip:port

example: iscsiadm -m discovery -t st -p

If successful you should get a response,1 iqn.2010-03.com.example:test.vm

Now you can login to the target iqn

iscsiadm -m node -T target_iqn_name -p ipaddress -l


iscsiadm -m node -T iqn.2010-03.com.example:test.vm -p -l

Here is if you want to login to all discovered LUNs

iscsiadm -m discovery -t st -l

The information is stored in the node database found in /var/lib/iscsi.

To log out of the target

iscsiadm -m node -T target_iqn_name -p ipaddress -u


iscsiadm -m node -T iqn.2010-03.com.example:test.vm -p -u

Then remove from the database so on a reboot it does not reconnect

iscsiadm -m node -T target_iqn_name -p ip address --op delete


iscsiadm -m node -T iqn.2010-03.com.example:test.vm -p --op delete

To logout of all targets

iscsiadm -m node -U all