I am trying to run shell build command on mac but I get permission denied
for e.g. ls /Users/...
command.
I see whoami
is jenkins
, which is different for my uesr login?
I read online I need to run chmod for jenkins user, how do I do that?
I changed file permission using chmod 777?
Do I need to change jenkins user?
Maybe you have a problem that jenkins
is not a full user. Try this:
Create a user for Jenkins
It’s best to run Jenkins as it’s own user (it can then be limited in the permissions it has), and you’ll want to create a standard (full) user for it.
You can do this through System Preferences, the Server Manager or the command line.
For a local user:
# create an applications group
dseditgroup -o create -n . -u username -p -r ‘Applications’ applications
# get the id for that group
sudo dscl . -read /Groups/applications
# find a unique identifier to give the user
sudo dscl . -list /Users UniqueID
# create the jenkins user
sudo dscl . -create /Users/jenkins
sudo dscl . -create /Users/jenkins PrimaryGroupID 505
sudo dscl . -create /Users/jenkins UniqueID 1026
sudo dscl . -create /Users/jenkins UserShell /bin/bash
sudo dscl . -create /Users/jenkins RealName "Jenkins"
sudo dscl . -create /Users/jenkins NFSHomeDirectory /Users/jenkins
sudo dscl . -passwd /Users/jenkins
# create and set the owner of the home directory
sudo mkdir /Users/jenkins
sudo chown -R jenkins /Users/jenkins
I found this here: installing jenkins on OS X Yosemite
In linux, e.g. ubuntu, you can add user jenkins to the root group:
sudo usermod -a -G root jenkins
Then restart jenkins:
sudo service jenkins restart
Be aware that, adding jenkins user to root group can make the user too powerful, use with caution
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With