问题
I have downloaded Jenkins on Windows10. When i try to access jenkins, it is asking for username and password. I have read the threads on the same issue. But I do not find any secrets folder or config.xml file under Jenkins folder.
回答1:
Username is admin. Password should be located in:
$JENKINS_HOME/secrets/initialAdminPassword
You can view the password using:
cat /var/lib/jenkins/secrets/initialAdminPassword
or
cat $JENKINS_HOME/secrets/initialAdminPassword
回答2:
If you're using Jenkins inside of a Docker container, like I am, the following commands might be useful.
docker exec -it ${jenkins_container_name} \
cat /var/jenkins_home/secrets/initialAdminPassword
# or if it was the last container you ran
docker exec -it $(docker container ls -l --format "{{.Names}}") \
cat /var/jenkins_home/secrets/initialAdminPassword
回答3:
After Installation of Jenkins 2.Y.Z
, I would suggest you to simply restart your OS.
my OS
is Windows 8.1
, and as after I restarted Jenkins
automatically builds it installation environment, and you can see many directories and files available or appeared which were not available instantly after installation.
Now, Open Jenkins Dashboard
path in web browser hostname:portnumber
for beginners it is like localhost:8080
it will ask you the password.
So, open the file initialAdminPassword
in text editor or viewer located in:
C:\Program Files (x86)\Jenkins\secrets\
copy the 32 chars length password
, and paste it to the Jenkins
Dashboard.
Later you can install the plugins
default or in custom choose mode.
Hope this would help many one.
回答4:
I had this exact issue as well. After installing Jenkins, the installation directory just had some config files and the jre
and bin
folders. After rebooting Windows 10 I was able to see all the normal folders you would expect in a Jenkins installation:
- jobs
- jre
- logs
- nodes
- plugins
- secrets - The "secrets" folder only appeared after rebooting, and in it was
initialAdminPassword
just as promised.
Now going to http://localhost:8080 loads the "Unlock Jenkins" page.
Really, though. I should have known to reboot. It is Windows after all...
回答5:
open the door
sudo chmod -R 777 secrets
peek inside
vi secrets/initialAdminPassword
close the door
sudo chmod -R 700 secrets
来源:https://stackoverflow.com/questions/46840692/default-credentials-for-jenkins-after-installation