Jenkins 的默认密码是什么? [英] What is the default Jenkins password?

查看:112
本文介绍了Jenkins 的默认密码是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 EC2 服务器实例.使用以下安装 Jenkins:

I'm using a EC2 server instance. Used the following to install Jenkins:

wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins

但我需要在 Jenkins 服务器上安装软件,所以在我的 EC2 实例中我做了

but I need to install software on the Jenkins server so in my EC2 instance I did

sudo –s –H –u jenkins

进入詹金斯服务器.然后我试着做

to get into the jenkins server. Then I tried to do

sudo cabal install quickcheck

但它提示我输入 jenkins 密码.我已经在互联网上搜索了 4 小时,但没有任何帮助我在 jenkins 服务器中获得管理权限.

but it prompted me for jenkins password. I've been searching around the internet for 4hrs now and nothing is helping me get administrative privilege in the jenkins server.

所以我在 shell 中使用以下命令构建我的项目:

So I'm building my project using the following command in shell:

sudo cabal clean
sudo cabal configure
sudo cabal build
sudo cabal install

这是我得到的错误:

 Started by timer
Building in workspace /var/lib/jenkins/jobs/Finance/workspace
Checkout:workspace / /var/lib/jenkins/jobs/Finance/workspace - hudson.remoting.LocalChannel@eea6dc
Using strategy: Default
Last Built Revision: Revision b638e2182dece0ef1a40232b1d75fa3ae5c01a5d (origin/master)
Fetching changes from 1 remote Git repository
Fetching upstream changes from origin
Commencing build of Revision b638e2182dece0ef1a40232b1d75fa3ae5c01a5d (origin/master)
Checking out Revision b638e2182dece0ef1a40232b1d75fa3ae5c01a5d (origin/master)
[workspace] $ /bin/sh -xe /tmp/hudson3500373817395137440.sh
+ sudo cabal clean
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts
Build step 'Execute shell' marked build as failure
Sending e-mails to: ***@gmail.com
ERROR: Could not connect to SMTP host: localhost, port: 25
javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
  nested exception is:
    java.net.ConnectException: Connection refused
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
    at javax.mail.Service.connect(Service.java:295)
    at javax.mail.Service.connect(Service.java:176)
    at javax.mail.Service.connect(Service.java:125)
    at javax.mail.Transport.send0(Transport.java:194)
    at javax.mail.Transport.send(Transport.java:124)
    at hudson.tasks.MailSender.execute(MailSender.java:116)
    at hudson.tasks.Mailer.perform(Mailer.java:117)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:814)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:786)
    at hudson.model.Build$BuildExecution.post2(Build.java:183)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:733)
    at hudson.model.Run.execute(Run.java:1592)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:237)
Caused by: java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
    at java.net.Socket.connect(Socket.java:579)
    at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:286)
    at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:231)
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900)
    ... 17 more
Finished: FAILURE

推荐答案

解决方法如下:

  • 阻止詹金斯
  • 去编辑/var/lib/jenkins/config.xml
  • true 更改为 false
  • 重启Jenkins:sudo service jenkins restart
  • 导航到 Jenkins 仪表板,找到您之前可能使用过的配置安全性"选项.这一次,设置安全和以前一样,但设置为允许任何人做任何事情,并允许用户注册.
  • 转到 www.yoursite.com/securityRealm/addUser 并创建一个用户
  • 然后将允许任何人做任何事情更改为您真正希望用户能够做的任何事情.就我而言,它是允许登录用户做任何事情.
  • Stop Jenkins
  • Go go edit /var/lib/jenkins/config.xml
  • Change <useSecurity>true</useSecurity> to false
  • Restart Jenkins: sudo service jenkins restart
  • Navigate to the Jenkins dashboard to the "Configure Security" option you likely used before. This time, setup security the same as before, BUT set it to allow anyone to do anything, and allow user signup.
  • Go to www.yoursite.com/securityRealm/addUser and create a user
  • Then go change allow anyone to do anything to whatever you actually want users to be able to do. In my case, it is allow logged in users to do anything.

这篇关于Jenkins 的默认密码是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆