windows 安装后 Jenkins 的默认凭据
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46840692/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Default credentials for Jenkins after installation
提问by MRavindran
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.
我已经在 Windows10 上下载了 Jenkins。当我尝试访问 jenkins 时,它要求输入用户名和密码。我已经阅读了关于同一问题的线程。但是我在 Jenkins 文件夹下没有找到任何 secrets 文件夹或 config.xml 文件。
回答by pat
Username is admin. Password should be located in:
用户名为admin。密码应位于:
$JENKINS_HOME/secrets/initialAdminPassword
You can view the password using:
您可以使用以下方法查看密码:
cat /var/lib/jenkins/secrets/initialAdminPassword
or
或者
cat $JENKINS_HOME/secrets/initialAdminPassword
回答by ngenetzky
If you're using Jenkins inside of a Docker container, like I am, the following commands might be useful.
如果您像我一样在 Docker 容器内使用 Jenkins,那么以下命令可能会很有用。
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
回答by ArifMustafa
After Installation of Jenkins 2.Y.Z
, I would suggest you to simply restart your OS.
安装后Jenkins 2.Y.Z
,我建议您只需重新启动操作系统。
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.
my OS
is Windows 8.1
,并且在我重新启动后Jenkins
自动构建它的安装环境,您可以看到许多可用的目录和文件,或者安装后立即出现不可用的目录和文件。
Now, Open Jenkins Dashboard
path in web browser hostname:portnumber
现在,Jenkins Dashboard
在网络浏览器中打开路径hostname:portnumber
for beginners it is like localhost:8080
对于初学者来说就像 localhost:8080
it will ask you the password.
它会问你密码。
So, open the file initialAdminPassword
in text editor or viewer located in:
因此,initialAdminPassword
在位于以下位置的文本编辑器或查看器中打开文件:
C:\Program Files (x86)\Jenkins\secrets\
copy the 32 chars length password
, and paste it to the Jenkins
Dashboard.
复制 32 个字符的长度password
,并将其粘贴到Jenkins
仪表板。
Later you can install the plugins
default or in custom choose mode.
稍后您可以安装plugins
默认或自定义选择模式。
Hope this would help many one.
希望这会帮助很多人。
回答by Greg Burghardt
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:
我也有这个确切的问题。安装Jenkins后,安装目录只有一些配置文件jre
和bin
文件夹。重新启动 Windows 10 后,我能够看到您在 Jenkins 安装中期望的所有普通文件夹:
- jobs
- jre
- logs
- nodes
- plugins
- secrets- The "secrets" folder only appeared after rebooting, and in it was
initialAdminPassword
just as promised.
- 工作
- jre
- 日志
- 节点
- 插件
- 秘密- “秘密”文件夹仅在重新启动后出现,并且
initialAdminPassword
正如承诺的那样。
Now going to http://localhost:8080loads the "Unlock Jenkins" page.
现在转到http://localhost:8080会加载“解锁 Jenkins”页面。
Really, though. I should have known to reboot. It is Windows after all...
不过真的。我应该知道重新启动。毕竟是Windows...
回答by Anand
open the door
开门
sudo chmod -R 777 secrets
须藤 chmod -R 777 秘密
peek inside
偷看里面
vi secrets/initialAdminPassword
vi 秘密/初始管理员密码
close the door
关门
sudo chmod -R 700 secrets
须藤 chmod -R 700 秘密