jenkins shell脚本执行权限不够解决办法

自己服务器搭建jenkins执行操作的时候,没有相应的权限,解决这个问题的时候,做了一些笔记分享给大家.

1.查看jenkins默认用户

vi /etc/sysconfig/jenkins
复制代码

找到JENKINS_USER发现默认用户jenkins

# Unix user account that runs the Jenkins daemon
# Be careful when you change this, as you need to update
# permissions of $JENKINS_HOME and /var/log/jenkins.
#
JENKINS_USER="jenkins"
复制代码

修改为JENKINS_USER="root"

2.修改默认用户权限

chrow -R root:root /val/lib/jenkins
chrow -R root:root /val/cache/jenkins
chrow -R root:root /val/log/jenkins
复制代码

重新启动后就可以了

service jenkins restart

还可以给jenkins用户添加相应的权限

chown -R jenkins

你可能感兴趣的:(jenkins shell脚本执行权限不够解决办法)