Jenkins (1) Authentication authority management based on Role-based
(1) introduction
In the newly installed jenkins, user permissions are not set by default, which means that entering the home page is administrator privileges. For security, we need to configure user permissions. If the permission setting is not good, the access will appear "hudson.security.AccessDeniedException2: anonymous does not have all / Read permissions". The most basic solution is to go to the installation directory and delete the config.xml file. Just restart the service.
1. Start jenkins chown-R 1000 it 1000 / var/jenkinsdocker run-it-- name jenkins-p8888 it 8080-v / var/jenkins:/var/jenkins_home/ jenkins2, jenkins restart docker restart jenkins3, enter jenkinsdocker exec-it lqbjenkins bash
(2) configure user registration
1. Install the role-base plug-in. System management-plug-in management-optional plug-in-filter role-base, install the plug-in.
2. Enable global security configuration. System Management-Global Security configuration-enable Security-Select jenkins proprietary user database in access control and Role-Based Strategy in authorization policy
3. Create administrative users. System Management-manage users-New users
4. Configure Manage and Assign Roles
4.1. Configuration management role. Add global roles and project roles. The global roles dev-roles and test-roles are all Read, and the project role is Read.
4.2. The user binds project roles and assigns roles. The picture is as follows. Previously, we defined dev_roles and test_roles rules in Project roles, corresponding to dev-., respectively. And test-. Here we associate the user with the roles, so that the corresponding user has the permission of the corresponding roles
5. Exit management and log in to dev and test to view the corresponding pages.