3

I forgot the user credentials.Tried to follow the links on SO but I am not able to find the file paths.Links are mentioned below.How to reset the credentials on mac OS Sierra?

Reset Jenkins Configuration Command Line

Community
  • 1
  • 1
Ram
  • 1,872
  • 5
  • 31
  • 54

4 Answers4

8

For macOS, the config.xml file is located in:

/Users/<USERNAME>/.jenkins

As the other post says, change:

<useSecurity>true</useSecurity>

to

<useSecurity>false</useSecurity>
Ruth N
  • 151
  • 2
  • 7
6

Run the following command to find the Jenkins username and encrypted password

cat /Users/{USERNAME}/.jenkins/credentials.xml

if you want to reset the password please follow the below steps

1.Use command – $ vim /Users/{USERNAME}/.jenkins/config.xml file.

2.Go to <useSecurity> tag and check value, it will be true.

  1. Press i so it file will be in insert mode. Then you can update the file. You need to update <useSecurity> tag value to false as below.

4.Save this file and exit from file. Press Escape and then enter :wq – to save updated file )

5.Once you are done with updating value in config.xml file. Restart Jenkins service. Use command ( $ brew services Restart Jenkins )

6.Now open Jenkins URL. It will go to dashboard direct. No any credentials required. You can see after opening dashboard ‘Logged in user’ section will be blank. As it is now Anonymous user.

7.Now, Delete old admin users. To do that go to People option in left hand side bar.

silicontrip
  • 906
  • 7
  • 23
p K
  • 71
  • 1
  • 2
  • I probably wouldn't recommend using Vim to anyone not already using it. Users on SO should already know how to edit a text file, so simply saying edit `thisFile.txt` will suffice. :-) – silicontrip Mar 03 '21 at 10:25
2

Users config located in:

/Users/{USERNAME}/.jenkins/users/jenkins/config.xml

1

You need to set the <useSecurity>true</useSecurity>to <useSecurity>false</useSecurity> to login without user name and password

Steps:

cd /Users/<USERNAME>/.jenkins

nano config.xml

Change <useSecurity>true</useSecurity>to <useSecurity>false</useSecurity>

Restart Jenkins brew services restart jenkins-lts

Then you can login and reset your username and password

Rexben
  • 339
  • 4
  • 13