学习自:https://www.cnblogs.com/amberly/p/6288773.html
1. jenkins服务器重启之后, 再次登录提示登录无效.
重启多次也无法解决.
2. 根据文档查找jenkins的目录相关信息
ps -elf |grep jenkins 0 S jenkins 2162 1 5 80 0 - 1317767 futex_ 09:02 ? 00:00:50 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --daemon --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20 0 S root 2448 1895 0 80 0 - 28169 pipe_w 09:16 pts/0 00:00:00 grep --color=auto jenkins
找到jenkins的目录
-DJENKINS_HOME=/var/lib/jenkins
3. 进入目录
将config的文件修改一下
修改内容
修改<useSecurity>true</useSecurity>为<useSecurity>false</useSecurity> 删除<authorizationStrategy>*****</authorizationStrategy>和<securityRealm>****</securityRealm>两项
4. 重启jenkins登录
systemctl restart jenkins