Charlie Stelling

Working to end the revolving door of homelessness and having fun doing it.

Linux Permission Herdle

When you attempt to run a script for the first time in ubuntu you are likly to run into this hurdle.

root@server:srv/websitename# ./deploy.sh -bash: ./deploy.sh: permission denied

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 to run.

chmod +x deploy.sh

After that you should be able to run your script

./deploy.sh

Why did this happen?

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).

When you create a new file or download one, it defaults to rw- (read/write only) for security reasons.

Alternativly you can bypass the file permissions by called the interperter directly: sh deploy.sh

Leave a Reply

Your email address will not be published. Required fields are marked *

About Me

Charlie Stelling

Tinkerer

Hello, im charlie a passionate tinkerer, who loves sharing ideas, stories, and experiences. I assist rough sleepers in transitioning into long-term, stable housing.

Follow Me

Connect with me and be part of my community.