We ran into the same issue with Jenkins ver 2.164.2 on Ubuntu. After Jenkins master restart, the user accounts/password/security details were wiped out.
In our case it happened after a reboot + few plugin updates. 1. we had to disable security as per above suggestions 2. roll back the upgraded plugins to their previous version 3. enable security back (at this stage users still not able to login) 4. reload configuration from disk (it will quick-restart jenkins) 5. users were able to login again, using their original credentials
we suspect there was an issue while jenkins was loading config.xml causing it to somehow avoid the users/roles section.