Run sudo in Jenkins
Some script need to run with sudo command, if we get error that permission deny, we need to run with sudo.
To enable sudo in jenkins, need to add bellow line to /etc/sudoers
jenkins ALL=NOPASSWD: /pathOfMyScript
But if you don't use root user to make such change, you will get error:
sudo: /etc/sudoers is owned by uid xxx, should be 0
Bcoz we normally won't use root for dev. First need to enable root user:
Setting>user>Login Options>Network account server>Join buton>Open Directory Utility
In "Edit" menu, enable root user and set password, then logout and user root acc.
runn bellow command:
$cd etc $chgrp wheel sudoers $chown root /etc/sudoers
* User root to enhance sudoers will better.
相关推荐
yserver 2020-08-15
changecan 2020-11-19
sunnnyduan 2020-10-16
lonesomer 2020-09-17
houdaiye 2020-09-23
XPZ0 2020-09-22
changecan 2020-09-22
jackadmi 2020-09-11
yuan00yu 2020-08-24
liyansring 2020-08-15
liai 2020-08-09
山有木兮卿有意 2020-08-03
85206633 2020-07-28
suosuo 2020-07-28
83911930 2020-07-28
85590296 2020-07-22
liym 2020-07-20