Is it possible to allow jenkins to access the files that only root or some specific programs have access to? Is it possible to allow jenkins to access the files that only root or some specific programs have access to? linux linux

Is it possible to allow jenkins to access the files that only root or some specific programs have access to?


As bcolfer said, you should be able to just run your shell commands with "sudo" in front of it. You will want to be sure that the user that started the Jenkins slave is a sudoer.

As root, run "visudo", this will open the /etc/sudoers file. At the bottom add a line similar to this if it is not a current sudoer:

jenkins        ALL=(ALL)       NOPASSWD: ALL

"Jenkins" being the user that started the slave.

OR

You could try adding the user to the group that owns that directory. IF you run "ls -l" you should be able to see the permissions and then the user, and the group that owns the directory. Once you know the group, as root run:

usermod -a -G group Jenkins

"Jenkins" being the user that started the slave, and "group" being the actual group name.


One possibility is to use sudo to run commands that specifically target those files. There are a bunch of ways to manage the sudo privileges limit and log what actions happen on those files.