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개 답변
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
답변함 8달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠