Jenkins console : Permission Denied for /home/ec2-user/

0

Hello,

/var/lib/jenkins/workspace/dev-interview-cicd@tmp/durable-7a7f7a57/script.sh: line 1: cd: /home/ec2-user/: Permission denied

Role has been created and all the policies have been given to that role. And User has been created with all the polies specific to jenkins and ec2 that is used in jenkins pipeline. withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId:'', accessKeyVariable:'AWS_ACCESS_KEY_ID', secretKeyVariable:'AWS_SECRET_ACCESS_KEY']]) { } Is also given in pipeline job, but still giving permission denied.

1 Respuesta
0

Hi,

By default Jenkins pipelines runs on Jenkins user who has only permission to access /var/lib/jenkins/ directory. Add/Update the permissions of directory /home/ec2-user/ to make the Jenkins user access it.

Use this command to give access to the directory: sudo chmod -R +rw /home/ec2-user/

Comment here if you need further help.

profile picture
respondido hace 8 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas