Forgot Jenkins password or changed security

You, JenkinsUnix
Back

Did you changed security on and now you cannot login? Don't worry we've got you covered ;o). Do you have SSH access to the server? I have no idea what you could do if you don't have SSH access to the server, and this guide is only for ppl who has SSH access to the server.

Okay, here we go:

cd to .jenkins folder, in my case it is under /usr/share/tomcat6/.jenkins so cd /usr/share/tomcat6/.jenkins

Open the config.xml file from a vi or nano editor. vi config.xml

You might see <useSecurity>true</useSecurity> change it to false, so it shuold looks like <useSecurity>false</useSecurity>.

Then if you see something like 

  <authorizationStrategy class="hudson.security.GlobalMatrixAuthorizationStrategy">
    <permission>hudson.model.Item.Build:Developer</permission>
    <permission>hudson.model.Item.Cancel:Developer</permission>
    <permission>hudson.model.Item.Configure:Developer</permission>
    <permission>hudson.model.Item.Create:Developer</permission>
    <permission>hudson.model.Item.Delete:Developer</permission>
    <permission>hudson.model.Item.Discover:Developer</permission>
    <permission>hudson.model.Item.Read:Developer</permission>
    <permission>hudson.model.Item.Workspace:Developer</permission>
    <permission>hudson.model.Run.Delete:Developer</permission>
    <permission>hudson.model.Run.Update:Developer</permission>
  </authorizationStrategy>

Delete that one too.

© Heshan Wanigasooriya.RSS

🍪 This site does not track you.