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 réponse
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
répondu il y a 8 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions