Amu
Amu

Reputation: 161

Allowing jenkins to access contents of currently logged in user folder

I am using Jenkins to build my project in a Linux machine. During build operation files are read from a source location and files are to be copied to a new destination location.The source and destination locations are input by the user from Jenkins UI. I want the user to be able to select any folder located within his/her home folder as source or destination. For example: /home/jdoe/folder.

Currently, any folder inside /var/lib/jenkins, with jenkins:nogroup user-group, can be selected. However, a folder inside /home/jdoe/folder with same (jenkins:nogroup) user-group, and with the same permissions as the folders within /var/lib/jenkins, cannot be selected. I get a permission denied error on trying to read or write inside /home/jdoe/folder.

What can I do to enable reading and writing to a folder within the home folder of the currently logged in user? Can I set up Jenkins in a certain way to be able to do that, or do I have to change group settings for the home folder?Could you suggest a good configuration for me to be able to make this work?

Would there be any difference in using Jenkins on an Windows platform?

Upvotes: 2

Views: 2907

Answers (1)

Veer7
Veer7

Reputation: 21463

First make sure that the folder is having read-write access for jenkins user group.

sudo chmod -R 77 /home/jdoe

Also as in comment by Daniel, grant execute permission on the /home/jdoe folder.

sudo chmod a+x /home/jdoe

Upvotes: 2

Related Questions