jenkins构建失败shell命令权限被拒绝

问题描述:

我试图在Mac上运行shell build命令,但是得到permission denied例如ls /Users/...命令.

I am trying to run shell build command on mac but I get permission denied for e.g. ls /Users/... command.

我看到whoamijenkins,这与我的uesr登录有所不同吗?

I see whoami is jenkins, which is different for my uesr login?

我在线阅读我需要为jenkins用户运行chmod,我该怎么做?

I read online I need to run chmod for jenkins user, how do I do that?

我使用chmod 777更改了文件权限吗?

I changed file permission using chmod 777?

我需要更改詹金斯用户吗?

Do I need to change jenkins user?

在linux中,例如ubuntu,您可以将用户jenkins添加到根组:

In linux, e.g. ubuntu, you can add user jenkins to the root group:

sudo usermod -a -G root jenkins

然后重新启动詹金斯:

sudo service jenkins restart

请注意,将jenkins用户添加到root用户组可能会使用户过于强大,请谨慎使用

Be aware that, adding jenkins user to root group can make the user too powerful, use with caution