{"id":112,"date":"2026-02-17T18:05:28","date_gmt":"2026-02-17T18:05:28","guid":{"rendered":"https:\/\/charliestelling.co.uk\/?p=112"},"modified":"2026-02-17T18:05:28","modified_gmt":"2026-02-17T18:05:28","slug":"linux-permission-herdle","status":"publish","type":"post","link":"https:\/\/charliestelling.co.uk\/?p=112","title":{"rendered":"Linux Permission Herdle"},"content":{"rendered":"\n<p class=\"\">When you attempt to run a script for the first time in ubuntu you are likly to run into this hurdle. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@server:srv\/websitename# .\/deploy.sh -bash: .\/deploy.sh: permission denied<\/code><\/pre>\n\n\n\n<p class=\"\">This is because you dont have your execute bit set, so the shell is blocking you from running it. <br>To fix this issue you need to tell the system that the file is allowed to run. <br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x deploy.sh<\/code><\/pre>\n\n\n\n<p class=\"\">After that you should be able to run your script <\/p>\n\n\n\n<p class=\"\">.\/deploy.sh<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Why did this happen?<\/h5>\n\n\n\n<p class=\"\">In linux just because a file end in .sh does not mean the system treats it as a executable. Files have three types of permssions, Read (r), Write (w) and execute (x).<\/p>\n\n\n\n<p class=\"\">When you create a new file or download one, it defaults to rw- (read\/write only) for security reasons.<\/p>\n\n\n\n<p class=\"\">Alternativly you can bypass the file permissions by called the interperter directly: sh deploy.sh<\/p>\n\n\n\n<p class=\"\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you attempt to run a script for the first time in ubuntu you are likly to run into this hurdle. This is because you dont have your execute bit set, so the shell is blocking you from running it. To fix this issue you need to tell the system that the file is allowed [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":113,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-112","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/charliestelling.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/charliestelling.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/charliestelling.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/charliestelling.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/charliestelling.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=112"}],"version-history":[{"count":1,"href":"https:\/\/charliestelling.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions"}],"predecessor-version":[{"id":114,"href":"https:\/\/charliestelling.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions\/114"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/charliestelling.co.uk\/index.php?rest_route=\/wp\/v2\/media\/113"}],"wp:attachment":[{"href":"https:\/\/charliestelling.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/charliestelling.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/charliestelling.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}