You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Jenkins配置问题咨询:用户创建、登录及日志查看

Jenkins新手配置问题解决方案

Hey Rocky, let's work through each of your Jenkins issues step by step – I remember hitting similar roadblocks when I first started, so I know how confusing this can be!

1. 仪表盘无创建用户选项的问题

If you already created an admin user during initialization, the user management entry isn't on the main dashboard by default. Here's how to find it (and fix it if it's missing):

  • If you can still access Jenkins with a privileged account: Navigate to Manage Jenkins > Manage Users – this is where you'll find the option to create new users.
  • If you can't log in at all (ties into your second issue): You'll need to temporarily disable security to regain access:
    1. Locate your Jenkins home directory's config.xml file (I'll cover where this is in the next section).
    2. Find the line <useSecurity>true</useSecurity> and change it to <useSecurity>false</useSecurity>.
    3. Restart your Tomcat server. Once Jenkins reloads, you'll be able to access it without login prompts. Then head back to Manage Jenkins > Configure Global Security to re-enable security and set up user management properly.

2. Jenkins用户凭证的存储位置

Jenkins stores user-related data in two key places within your Jenkins home directory:

  • Local user accounts: Look for the users folder. Each user has their own subfolder named after their username (e.g., users/admin/). Inside each folder, the config.xml file contains the user's details, including their encrypted password hash.
  • Global credentials (like Git/Server credentials): These are stored in the root of the Jenkins home directory in the credentials.xml file.

To find your Jenkins home directory:

  • On Linux/macOS: It's usually ~/.jenkins by default.
  • On Windows: Check C:\Users\[Your Username]\.jenkins.
  • If you can access Jenkins (even temporarily), go to Manage Jenkins > System Configuration – the path is listed under "Jenkins home directory".

3. 查看Jenkins日志及调试登录失败

Where to find logs

You have two main log sources to check:

  • Tomcat server logs: These live in your Tomcat installation's logs folder. On Linux/macOS, the most useful one is catalina.out; on Windows, look for localhost.log or localhost_access_log.*.txt. These logs capture all output from Jenkins running inside Tomcat.
  • Jenkins internal logs: If you can access the Jenkins dashboard, go to Manage Jenkins > System Log. You can filter logs by level (like ERROR or WARNING) to zero in on login issues.

Debugging login failures

  • Check Tomcat logs first: Look for lines containing keywords like "Authentication failed" or "User not found" – these will tell you exactly why the login is failing (e.g., wrong password, disabled user, mismatched auth method).
  • Reset admin password if needed: If you forgot the admin password, edit the users/admin/config.xml file in your Jenkins home directory:
    1. Find the <passwordHash> line and replace its value with this default hash: #jbcrypt:$2a$10$DdaWzN64JgUtLdvxWIflcuQu2fgrrMSAMabF5TSrGK5nXitqK9ZMS (this corresponds to the password admin).
    2. Save the file and restart Tomcat – you'll now be able to log in with admin/admin.
  • Verify security settings: If you recently changed the authentication method (e.g., switched to LDAP), make sure your local admin user is still allowed to log in. Head to Manage Jenkins > Configure Global Security to check the "Security Realm" setting.

内容的提问来源于stack exchange,提问作者Rocky

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 06:39:27