34

I have a fresh install of Jenkins as a service on my Linux machine. When Jenkins installs, it creates a 'jenkins' user, but I can't seem to find the default password for it anywhere.

I'm trying to secure my system, so if the default password is '123' or something insecure that I just haven't thought of yet, that's a problem.

Thanks!

JD Russo
  • 422
  • 1
  • 5
  • 9

4 Answers4

74

I don't believe it has any password. You should be able to do:

sudo passwd jenkins

This will prompt for you to set a password.

Alternatively you could create the jenkins user prior to installing, and it would leverage that one.

thefourtheye
  • 233,700
  • 52
  • 457
  • 497
StefanGordon
  • 1,499
  • 15
  • 7
  • 2
    So if I were to try and ssh into the box as the Jenkins user, since there's no password, would I be able to? – JD Russo Jul 30 '14 at 15:52
  • 1
    You would have to have the following line in `/etc/ssh/sshd_config`: `PermitEmptyPasswords yes` – devtanc Apr 30 '16 at 22:25
3

For fedora,

  1. Go to /root/.jenkins/
  2. open config.xml
  3. In config.xml, set disableSignup to false.
  4. Restart Jenkins.
  5. Go to the Jenkins web page and sign up with a new user.
  6. In config.xml, duplicate one of the hudson.model.Hudson.Administer:username lines and replace username with the new user.
  7. If it's a private server, set disableSignup back to true in config.xml. Restart Jenkins.
  8. Go to the Jenkins web page and log in as the new user.
  9. Reset the password of the original user.
  10. Log in as the original user.
Community
  • 1
  • 1
1

Default password for user jenkins is just "jenkins". However, logging into this user automatically closes your session (probably it is set to be used only to allow using particular computer as a jenkins agent, but I'm not sure). That't why su - jenkins and typing jenkins do not work.

You can try logging as a jenkins user with ssh and you will see that it works, but suddenly the session is closed:

enter image description here

I believe there is a solution for this, but maybe it is not needed in your case. Really need to use system as a jenkins user? Doubt it.

Mat21445
  • 53
  • 6
  • 1
    I appreciate the response! If I'm remembering correctly (which I very well may not be, it's been a while) my concern was about potential security vulnerabilities from having a default username/password enabled. I didn't want to do anything with it, just wanted to be sure others couldn't. – JD Russo Feb 08 '22 at 18:58
0

C:\Windows\system32\config\systemprofile.jenkins\secrets\

goto above mentioned path and find

"initialAdminPassword" click that file and copy value this is password for jenkins!

Vinay Prajapati
  • 7,199
  • 9
  • 45
  • 86
  • 4
    The OP is talking about the jenkins system user, not the administrator defined in jenkins' users. – Yvan Jan 07 '18 at 14:33
  • 1
    The question is not about jenkins administrator user for jenkins web UI console but the system user 'jenkins' created due to jenkins installation. – veer7 Mar 07 '18 at 08:14