-1

I'm trying to do a shell execute in Jenkins build step. I have a binary executable in /home/ubuntu/.local/bin/aws which is called from Jenkins executable script.

In the build output log, it reads /tmp/jenkins2312.sh: line 2: /home/ubuntu/.local/bin/aws: Permission denied

Adding Jenkins user to Root Group didn't help.

Om Prakash
  • 29
  • 2
  • 5
  • 1
    Could you give us more details? what are the permissions for your sh and binary file? Who is the owner of those files and is Jenkins allowed to access them. CAn you execute sh file as Jenkins user(not by Jenkins software)? I don't think that giving root access to Jenkins is good idea. – szmyru - Irek Sz. Sep 07 '18 at 08:04

4 Answers4

1

Give execute permission to aws file.

chmod +x /home/ubuntu/.local/bin/aws

Subhash
  • 762
  • 9
  • 25
0

Is the file executable for jenkins?

If you are on the machine you could set it to have suitable executable permissions (chmod 755 /home/ubuntu/.local/bin/aws )

You should only have to do this once.

Nyxter
  • 405
  • 5
  • 20
  • Trying to access the file as Jenkins user, I get permission denied error. I also chown the executable to Jenkins use/group. It didn't help. – Om Prakash Sep 07 '18 at 16:49
0

In Ubuntu you need to stop and start Jenkins after you change jenkins's user's permissions. For me, restarting Jenkins didn't work but stop and start did.

Sohail Ahmed
  • 1,047
  • 1
  • 11
  • 27
0

your aws executable should in this location

/usr/local/bin/aws

then should work as you want, I don't think on .local

Guru
  • 419
  • 4
  • 13