在CentOS上设置和管理Jenkins权限通常涉及以下几个方面:
sudo yum install java-11-openjdk-devel
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repos
sudo rpm --import https://pkg.jenkins-ci.org/redhat-stable/jenkins.io.keys
sudo yum install jenkins
sudo vim /etc/sysconfig/jenkins
# 修改JENKINS_PORT行,例如设置为8080
sudo systemctl enable jenkins
sudo systemctl start jenkins
sudo useradd jenkins
sudo passwd jenkins
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
sudo semanage fcontext -a -t jenkins_home_t "/var/lib/jenkins(/.*)?"
sudo restorecon -Rv /var/lib/jenkins
通过上述步骤,您可以在CentOS上成功设置和管理Jenkins的权限,确保系统的安全性和稳定性。