Make Shell Scripts Executable
Get the chmod command to make a script runnable while keeping it secure.
| Read | Write | Execute | Value | |
|---|---|---|---|---|
| owner | 7 | |||
| group | 5 | |||
| other | 5 |
$ chmod 755 filename
Common presets
Scripts tips
To run a script directly (./script.sh), it needs the execute bit. 755 makes it executable by everyone; 700 keeps it private to you.
For scripts in a shared bin directory, 755 is standard. For personal scripts with sensitive logic, use 700.
After making it executable, verify with the symbolic output here — you want an "x" in the owner triad at minimum.
როგორ მუშაობს
რატომ გამოვიყენოთ ჩვენი?
Also check out…
Correct File Permissions for Web Servers
Set the right permissions for web files and folder
Set SSH Key Permissions
SSH refuses keys with loose permissions. Get the e
Learn Linux File Permissions
Understand how octal and symbolic Unix permissions
File Permissions in Docker Images
Set correct permissions for files copied into Dock
