Recover access to Jenkins

Have you lost the password for Jenkins? Or maybe you changed some security settings and now you cant log in?

You need to recover access. This is quite simple. The strategy will be to disable security for Jenkins,  login and reset user’s password (you can also create a new user), re-enable security.

By default in Linux, Jenkins is installed into location /var/lib/jenkins. you will need to edit the configuration file here: config.xml and change <useSecurity>true</useSecurity> to <useSecurity>false</useSecurity> then restart Jenkins service: service jenkins restart
Open Jenkins WEB console, go to People, click on the username, Configure, set the new password and save changes.

You now have access to Jenkins!

PS: I presume you have SSH access to server. It worked for me with Ubuntu 14.04/Debian 8.5 and Jenkins 2.7.2