Permission denied executing shell script on remote host using ssh – Jenkins

Today I was setting up a Jenkins pipeline for one of my project and noticed deploy job fails every time it try to execute the script on a remote Linux machine stating the reason – “Build step ‘Execute shell script on remote host using ssh’ marked build as failure”, as follows:

executing script:

./stage-deployment/scripts/stage-node_deploy.sh
bash: line 1: ./stage-deployment/scripts/stage-node_deploy.sh: Permission denied
[SSH] exit-status: 126
Build step 'Execute shell script on remote host using ssh' marked build as failure

If you are facing the same problem as me then you can fix it after changing the permissions of a directory containing executable, as:

chmod --recursive a+rwx /stage-deployment/scripts/
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s